diff options
author | Rigel Kent <sendmemail@rigelk.eu> | 2021-10-25 17:42:20 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-25 17:42:20 +0200 |
commit | 276250f0a36e00373166d91d539e5220d6f158c7 (patch) | |
tree | 394e4fd65912edbbe9266ccfbacfc14f433371e7 /client/src/app/+videos | |
parent | b2ad0090c182c7f2a8cba1cced3987d408a4b159 (diff) | |
download | PeerTube-276250f0a36e00373166d91d539e5220d6f158c7.tar.gz PeerTube-276250f0a36e00373166d91d539e5220d6f158c7.tar.zst PeerTube-276250f0a36e00373166d91d539e5220d6f158c7.zip |
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 <me@florianbigard.com>
Diffstat (limited to 'client/src/app/+videos')
-rw-r--r-- | client/src/app/+videos/+video-edit/video-add-components/video-upload.component.ts | 7 |
1 files changed, 4 insertions, 3 deletions
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 | |||
82 | uploaderClass: UploaderXFormData, | 82 | uploaderClass: UploaderXFormData, |
83 | chunkSize, | 83 | chunkSize, |
84 | retryConfig: { | 84 | retryConfig: { |
85 | maxAttempts: 6, | 85 | maxAttempts: 30, // maximum attempts for 503 codes, otherwise set to 6, see below |
86 | shouldRetry: (code: number) => { | 86 | maxDelay: 120_000, // 2 min |
87 | return code < 400 || code >= 501 | 87 | shouldRetry: (code: number, attempts: number) => { |
88 | return code === HttpStatusCode.SERVICE_UNAVAILABLE_503 || ((code < 400 || code > 500) && attempts < 6) | ||
88 | } | 89 | } |
89 | } | 90 | } |
90 | } | 91 | } |