From 276250f0a36e00373166d91d539e5220d6f158c7 Mon Sep 17 00:00:00 2001 From: Rigel Kent Date: Mon, 25 Oct 2021 17:42:20 +0200 Subject: prevent multiple post-process triggering of upload-resumable (#4175) * prevent multiple post-process triggering of upload-resumable * switch from 409 to 503 for upload being processed * Improve resumable upload check Co-authored-by: Chocobozzz --- .../+video-edit/video-add-components/video-upload.component.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'client/src') diff --git a/client/src/app/+videos/+video-edit/video-add-components/video-upload.component.ts b/client/src/app/+videos/+video-edit/video-add-components/video-upload.component.ts index 6f72a07c4..91d89a535 100644 --- a/client/src/app/+videos/+video-edit/video-add-components/video-upload.component.ts +++ b/client/src/app/+videos/+video-edit/video-add-components/video-upload.component.ts @@ -82,9 +82,10 @@ export class VideoUploadComponent extends VideoSend implements OnInit, OnDestroy uploaderClass: UploaderXFormData, chunkSize, retryConfig: { - maxAttempts: 6, - shouldRetry: (code: number) => { - return code < 400 || code >= 501 + maxAttempts: 30, // maximum attempts for 503 codes, otherwise set to 6, see below + maxDelay: 120_000, // 2 min + shouldRetry: (code: number, attempts: number) => { + return code === HttpStatusCode.SERVICE_UNAVAILABLE_503 || ((code < 400 || code > 500) && attempts < 6) } } } -- cgit v1.2.3