tus: adjust retry delay + remove logging

From the logs, it seems like the second retry (5s) fixes the "normal" cases, so just remove the first retry (0s).

Also from the logs, if a retry doesn't work by the third attempt (10s), it's most likely the "locked" case and retrying further doesn't help. So, reduce one more useless retry attemp.

Removed logging since we've gathered enough data, and that this hook is expected to be hit a lot, so we don't want to clog the logs.
This commit is contained in:
infinite-persistence 2022-01-13 09:33:49 +08:00
parent 9e70629ada
commit 238f6b2eda
No known key found for this signature in database
GPG key ID: B9C3252EDC3D0AA0

View file

@ -60,7 +60,7 @@ export function makeResumableUploadRequest(
const uploader = new tus.Upload(file, {
...urlOptions,
chunkSize: UPLOAD_CHUNK_SIZE_BYTE,
retryDelays: [0, 5000, 10000, 15000, 30000],
retryDelays: [5000, 10000, 30000],
parallelUploads: 1,
storeFingerprintForResuming: false,
removeFingerprintOnSuccess: true,
@ -72,7 +72,6 @@ export function makeResumableUploadRequest(
onShouldRetry: (err, retryAttempt, options) => {
window.store.dispatch(doUpdateUploadProgress({ guid, status: 'retry' }));
const status = err.originalResponse ? err.originalResponse.getStatus() : 0;
analytics.error(`tus: retry=${uploader._retryAttempt}, status=${status}`);
return !inStatusCategory(status, 400) || status === STATUS_CONFLICT || status === STATUS_LOCKED;
},
onError: (err) => {