Browse Source

End runner live transcoding on update error

pull/5340/merge
Chocobozzz 1 week ago
parent
commit
fa3da7a623
No known key found for this signature in database GPG Key ID: 583A612D890159BE
1 changed files with 5 additions and 2 deletions
  1. +5
    -2
      packages/peertube-runner/server/process/shared/process-live.ts

+ 5
- 2
packages/peertube-runner/server/process/shared/process-live.ts View File

@@ -248,6 +248,8 @@ export class ProcessLiveRTMPHLSTranscoding {
private async sendPendingChunks (): Promise<any> {
if (this.ended) return Promise.resolve()

const promises: Promise<any>[] = []

for (const playlist of this.pendingChunksPerPlaylist.keys()) {
for (const chunk of this.pendingChunksPerPlaylist.get(playlist)) {
logger.debug(`Sending added live chunk ${chunk} update`)
@@ -271,12 +273,13 @@ export class ProcessLiveRTMPHLSTranscoding {
}
}

this.updateWithRetry(payload)
.catch(err => logger.error({ err }, 'Cannot update with retry'))
promises.push(this.updateWithRetry(payload))
}

this.pendingChunksPerPlaylist.set(playlist, [])
}

await Promise.all(promises)
}

private async updateWithRetry (payload: LiveRTMPHLSTranscodingUpdatePayload, currentTry = 1): Promise<any> {


Loading…
Cancel
Save