backend: Improve participant check in recording service before starting recording
This commit is contained in:
parent
85e65d76b3
commit
894e6a8f94
@ -73,7 +73,9 @@ export class RecordingService {
|
|||||||
|
|
||||||
if (!lkRoom) throw errorRoomNotFound(roomId);
|
if (!lkRoom) throw errorRoomNotFound(roomId);
|
||||||
|
|
||||||
if (lkRoom.numParticipants === 0) throw errorRoomHasNoParticipants(roomId);
|
const hasParticipants = await this.livekitService.roomHasParticipants(roomId);
|
||||||
|
|
||||||
|
if (!hasParticipants) throw errorRoomHasNoParticipants(roomId);
|
||||||
|
|
||||||
// Attempt to acquire lock. If the lock is not acquired, the recording is already active.
|
// Attempt to acquire lock. If the lock is not acquired, the recording is already active.
|
||||||
acquiredLock = await this.acquireRoomRecordingActiveLock(roomId);
|
acquiredLock = await this.acquireRoomRecordingActiveLock(roomId);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user