End runner live transcoding on update error
This commit is contained in:
parent
6a9b315182
commit
fa3da7a623
1 changed files with 5 additions and 2 deletions
|
@ -248,6 +248,8 @@ export class ProcessLiveRTMPHLSTranscoding {
|
||||||
private async sendPendingChunks (): Promise<any> {
|
private async sendPendingChunks (): Promise<any> {
|
||||||
if (this.ended) return Promise.resolve()
|
if (this.ended) return Promise.resolve()
|
||||||
|
|
||||||
|
const promises: Promise<any>[] = []
|
||||||
|
|
||||||
for (const playlist of this.pendingChunksPerPlaylist.keys()) {
|
for (const playlist of this.pendingChunksPerPlaylist.keys()) {
|
||||||
for (const chunk of this.pendingChunksPerPlaylist.get(playlist)) {
|
for (const chunk of this.pendingChunksPerPlaylist.get(playlist)) {
|
||||||
logger.debug(`Sending added live chunk ${chunk} update`)
|
logger.debug(`Sending added live chunk ${chunk} update`)
|
||||||
|
@ -271,12 +273,13 @@ export class ProcessLiveRTMPHLSTranscoding {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.updateWithRetry(payload)
|
promises.push(this.updateWithRetry(payload))
|
||||||
.catch(err => logger.error({ err }, 'Cannot update with retry'))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this.pendingChunksPerPlaylist.set(playlist, [])
|
this.pendingChunksPerPlaylist.set(playlist, [])
|
||||||
}
|
}
|
||||||
|
|
||||||
|
await Promise.all(promises)
|
||||||
}
|
}
|
||||||
|
|
||||||
private async updateWithRetry (payload: LiveRTMPHLSTranscodingUpdatePayload, currentTry = 1): Promise<any> {
|
private async updateWithRetry (payload: LiveRTMPHLSTranscodingUpdatePayload, currentTry = 1): Promise<any> {
|
||||||
|
|
Loading…
Reference in a new issue