fix: reconcile sessions before auto-start
This commit is contained in:
@@ -126,9 +126,17 @@ public sealed class RecordService
|
||||
throw new InvalidOperationException("The live room is disabled. Enable it before starting a recording.");
|
||||
}
|
||||
|
||||
await ReconcileActiveSessionsAsync(liveRoom.Id, cancellationToken);
|
||||
var activeSession = await _recordSessionRepository.GetActiveByLiveRoomIdAsync(liveRoom.Id, cancellationToken);
|
||||
if (activeSession is not null)
|
||||
{
|
||||
await _systemLogService.WriteAsync(
|
||||
SystemLogLevel.Warning,
|
||||
"RecordSession",
|
||||
"Recording start skipped because an active session still exists after reconciliation.",
|
||||
liveRoomId: liveRoom.Id,
|
||||
recordSessionId: activeSession.Id,
|
||||
cancellationToken: cancellationToken);
|
||||
throw new InvalidOperationException("An active recording session already exists for the live room.");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user