aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/live-manager.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/lib/live-manager.ts')
-rw-r--r--server/lib/live-manager.ts12
1 files changed, 12 insertions, 0 deletions
diff --git a/server/lib/live-manager.ts b/server/lib/live-manager.ts
index 2702437c4..fe5b33322 100644
--- a/server/lib/live-manager.ts
+++ b/server/lib/live-manager.ts
@@ -99,6 +99,10 @@ class LiveManager {
99 } 99 }
100 }) 100 })
101 101
102 // Cleanup broken lives, that were terminated by a server restart for example
103 this.handleBrokenLives()
104 .catch(err => logger.error('Cannot handle broken lives.', { err }))
105
102 setInterval(() => this.updateLiveViews(), VIEW_LIFETIME.LIVE) 106 setInterval(() => this.updateLiveViews(), VIEW_LIFETIME.LIVE)
103 } 107 }
104 108
@@ -468,6 +472,14 @@ class LiveManager {
468 } 472 }
469 } 473 }
470 474
475 private async handleBrokenLives () {
476 const videoIds = await VideoModel.listPublishedLiveIds()
477
478 for (const id of videoIds) {
479 await this.onEndTransmuxing(id, true)
480 }
481 }
482
471 static get Instance () { 483 static get Instance () {
472 return this.instance || (this.instance = new this()) 484 return this.instance || (this.instance = new this())
473 } 485 }