}
})
+ // Cleanup broken lives, that were terminated by a server restart for example
+ this.handleBrokenLives()
+ .catch(err => logger.error('Cannot handle broken lives.', { err }))
+
setInterval(() => this.updateLiveViews(), VIEW_LIFETIME.LIVE)
}
}
}
+ private async handleBrokenLives () {
+ const videoIds = await VideoModel.listPublishedLiveIds()
+
+ for (const id of videoIds) {
+ await this.onEndTransmuxing(id, true)
+ }
+ }
+
static get Instance () {
return this.instance || (this.instance = new this())
}