backend: enhance signal sending methods in RecordingService and RoomService with error handling and logging
This commit is contained in:
parent
df3e0e05bb
commit
48c0133504
@ -486,9 +486,15 @@ export class RecordingService {
|
|||||||
* and sends it to the OpenVidu Components in the given room. The payload
|
* and sends it to the OpenVidu Components in the given room. The payload
|
||||||
* is adapted to match the expected format for OpenVidu Components.
|
* is adapted to match the expected format for OpenVidu Components.
|
||||||
*/
|
*/
|
||||||
sendRecordingSignalToOpenViduComponents(roomId: string, recordingInfo: MeetRecordingInfo) {
|
async sendRecordingSignalToOpenViduComponents(roomId: string, recordingInfo: MeetRecordingInfo) {
|
||||||
|
this.logger.debug(`Sending recording signal to OpenVidu Components for room '${roomId}'`);
|
||||||
const { payload, options } = OpenViduComponentsAdapterHelper.generateRecordingSignal(recordingInfo);
|
const { payload, options } = OpenViduComponentsAdapterHelper.generateRecordingSignal(recordingInfo);
|
||||||
return this.roomService.sendSignal(roomId, payload, options);
|
|
||||||
|
try {
|
||||||
|
await this.roomService.sendSignal(roomId, payload, options);
|
||||||
|
} catch (error) {
|
||||||
|
this.logger.debug(`Error sending recording signal to OpenVidu Components for room '${roomId}': ${error}`);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -326,6 +326,9 @@ export class RoomService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async sendRoomStatusSignalToOpenViduComponents(roomId: string, participantSid: string) {
|
async sendRoomStatusSignalToOpenViduComponents(roomId: string, participantSid: string) {
|
||||||
|
this.logger.debug(`Sending room status signal for room ${roomId} to OpenVidu Components.`);
|
||||||
|
|
||||||
|
try {
|
||||||
// Check if recording is started in the room
|
// Check if recording is started in the room
|
||||||
const activeEgressArray = await this.livekitService.getActiveEgress(roomId);
|
const activeEgressArray = await this.livekitService.getActiveEgress(roomId);
|
||||||
const isRecordingStarted = activeEgressArray.length > 0;
|
const isRecordingStarted = activeEgressArray.length > 0;
|
||||||
@ -342,6 +345,9 @@ export class RoomService {
|
|||||||
);
|
);
|
||||||
|
|
||||||
await this.sendSignal(roomId, payload, options);
|
await this.sendSignal(roomId, payload, options);
|
||||||
|
} catch (error) {
|
||||||
|
this.logger.debug(`Error sending room status signal for room ${roomId}:`, error);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -354,7 +360,7 @@ export class RoomService {
|
|||||||
*/
|
*/
|
||||||
async sendSignal(roomId: string, rawData: Record<string, unknown>, options: SendDataOptions): Promise<void> {
|
async sendSignal(roomId: string, rawData: Record<string, unknown>, options: SendDataOptions): Promise<void> {
|
||||||
this.logger.verbose(`Notifying participants in room ${roomId}: "${options.topic}".`);
|
this.logger.verbose(`Notifying participants in room ${roomId}: "${options.topic}".`);
|
||||||
this.livekitService.sendData(roomId, rawData, options);
|
await this.livekitService.sendData(roomId, rawData, options);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user