From 3f0ceab06e5320f62f593c49daa30d963dbc36f9 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 22 May 2023 15:52:59 +0200 Subject: More robust quota check Avoid concurrency issues with permanent lives --- server/lib/live/live-manager.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'server/lib/live/live-manager.ts') diff --git a/server/lib/live/live-manager.ts b/server/lib/live/live-manager.ts index f062e2fd3..5c6e69806 100644 --- a/server/lib/live/live-manager.ts +++ b/server/lib/live/live-manager.ts @@ -313,7 +313,7 @@ class LiveManager { const liveSession = await this.saveStartingSession(videoLive) const user = await UserModel.loadByLiveId(videoLive.id) - LiveQuotaStore.Instance.addNewLive(user.id, videoLive.id) + LiveQuotaStore.Instance.addNewLive(user.id, sessionId) const muxingSession = new MuxingSession({ context: this.getContext(), @@ -359,7 +359,7 @@ class LiveManager { muxingSession.on('after-cleanup', ({ videoUUID }) => { this.muxingSessions.delete(sessionId) - LiveQuotaStore.Instance.removeLive(user.id, videoLive.id) + LiveQuotaStore.Instance.removeLive(user.id, sessionId) muxingSession.destroy() -- cgit v1.2.3