aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/live/live-manager.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2023-05-22 15:52:59 +0200
committerChocobozzz <me@florianbigard.com>2023-05-22 15:52:59 +0200
commit3f0ceab06e5320f62f593c49daa30d963dbc36f9 (patch)
treec041455a11c55617251def4b7b35eff8d530a97a /server/lib/live/live-manager.ts
parentfa3da7a623fdb25be52ebff14e066a99ea9fb0cf (diff)
downloadPeerTube-3f0ceab06e5320f62f593c49daa30d963dbc36f9.tar.gz
PeerTube-3f0ceab06e5320f62f593c49daa30d963dbc36f9.tar.zst
PeerTube-3f0ceab06e5320f62f593c49daa30d963dbc36f9.zip
More robust quota check
Avoid concurrency issues with permanent lives
Diffstat (limited to 'server/lib/live/live-manager.ts')
-rw-r--r--server/lib/live/live-manager.ts4
1 files changed, 2 insertions, 2 deletions
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 {
313 const liveSession = await this.saveStartingSession(videoLive) 313 const liveSession = await this.saveStartingSession(videoLive)
314 314
315 const user = await UserModel.loadByLiveId(videoLive.id) 315 const user = await UserModel.loadByLiveId(videoLive.id)
316 LiveQuotaStore.Instance.addNewLive(user.id, videoLive.id) 316 LiveQuotaStore.Instance.addNewLive(user.id, sessionId)
317 317
318 const muxingSession = new MuxingSession({ 318 const muxingSession = new MuxingSession({
319 context: this.getContext(), 319 context: this.getContext(),
@@ -359,7 +359,7 @@ class LiveManager {
359 muxingSession.on('after-cleanup', ({ videoUUID }) => { 359 muxingSession.on('after-cleanup', ({ videoUUID }) => {
360 this.muxingSessions.delete(sessionId) 360 this.muxingSessions.delete(sessionId)
361 361
362 LiveQuotaStore.Instance.removeLive(user.id, videoLive.id) 362 LiveQuotaStore.Instance.removeLive(user.id, sessionId)
363 363
364 muxingSession.destroy() 364 muxingSession.destroy()
365 365