From fa3da7a623fdb25be52ebff14e066a99ea9fb0cf Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 22 May 2023 15:24:19 +0200 Subject: End runner live transcoding on update error --- packages/peertube-runner/server/process/shared/process-live.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'packages') diff --git a/packages/peertube-runner/server/process/shared/process-live.ts b/packages/peertube-runner/server/process/shared/process-live.ts index 6edb1f1e9..fae79e485 100644 --- a/packages/peertube-runner/server/process/shared/process-live.ts +++ b/packages/peertube-runner/server/process/shared/process-live.ts @@ -248,6 +248,8 @@ export class ProcessLiveRTMPHLSTranscoding { private async sendPendingChunks (): Promise { if (this.ended) return Promise.resolve() + const promises: Promise[] = [] + 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 { -- cgit v1.2.3