diff options
Diffstat (limited to 'packages')
-rw-r--r-- | packages/peertube-runner/server/process/shared/process-live.ts | 7 |
1 files changed, 5 insertions, 2 deletions
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 { | |||
248 | private async sendPendingChunks (): Promise<any> { | 248 | private async sendPendingChunks (): Promise<any> { |
249 | if (this.ended) return Promise.resolve() | 249 | if (this.ended) return Promise.resolve() |
250 | 250 | ||
251 | const promises: Promise<any>[] = [] | ||
252 | |||
251 | for (const playlist of this.pendingChunksPerPlaylist.keys()) { | 253 | for (const playlist of this.pendingChunksPerPlaylist.keys()) { |
252 | for (const chunk of this.pendingChunksPerPlaylist.get(playlist)) { | 254 | for (const chunk of this.pendingChunksPerPlaylist.get(playlist)) { |
253 | logger.debug(`Sending added live chunk ${chunk} update`) | 255 | logger.debug(`Sending added live chunk ${chunk} update`) |
@@ -271,12 +273,13 @@ export class ProcessLiveRTMPHLSTranscoding { | |||
271 | } | 273 | } |
272 | } | 274 | } |
273 | 275 | ||
274 | this.updateWithRetry(payload) | 276 | promises.push(this.updateWithRetry(payload)) |
275 | .catch(err => logger.error({ err }, 'Cannot update with retry')) | ||
276 | } | 277 | } |
277 | 278 | ||
278 | this.pendingChunksPerPlaylist.set(playlist, []) | 279 | this.pendingChunksPerPlaylist.set(playlist, []) |
279 | } | 280 | } |
281 | |||
282 | await Promise.all(promises) | ||
280 | } | 283 | } |
281 | 284 | ||
282 | private async updateWithRetry (payload: LiveRTMPHLSTranscodingUpdatePayload, currentTry = 1): Promise<any> { | 285 | private async updateWithRetry (payload: LiveRTMPHLSTranscodingUpdatePayload, currentTry = 1): Promise<any> { |