backend: Improve participant check in recording service before starting recording

This commit is contained in:
Carlos Santos 2025-04-10 12:27:33 +02:00
parent 85e65d76b3
commit 894e6a8f94

View File

@ -73,7 +73,9 @@ export class RecordingService {
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.
acquiredLock = await this.acquireRoomRecordingActiveLock(roomId);