mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-27 02:51:57 +02:00
Merge pull request #22107 from overleaf/jpa-error-handling
[history-v1] back_fill_file_hash: error handling GitOrigin-RevId: 2dbf52d015206cf42ca434b1f16221d6e0f2cc2b
This commit is contained in:
@@ -140,6 +140,10 @@ async function verifyMd5(persistor, bucket, key, sourceMd5, destMd5 = null) {
|
||||
}
|
||||
|
||||
function wrapError(error, message, params, ErrorType) {
|
||||
params = {
|
||||
...params,
|
||||
cause: error,
|
||||
}
|
||||
if (
|
||||
error instanceof NotFoundError ||
|
||||
['NoSuchKey', 'NotFound', 404, 'AccessDenied', 'ENOENT'].includes(
|
||||
|
||||
@@ -356,7 +356,8 @@ async function processFile(entry, filePath) {
|
||||
{ err, projectId, fileId, hash, path, attempt },
|
||||
'failed to process file, trying again'
|
||||
)
|
||||
await setTimeout(RETRY_DELAY_MS)
|
||||
const jitter = Math.random() * RETRY_DELAY_MS
|
||||
await setTimeout(RETRY_DELAY_MS + jitter)
|
||||
}
|
||||
}
|
||||
return await processFileOnce(entry, filePath)
|
||||
@@ -1000,7 +1001,8 @@ class ProjectContext {
|
||||
{ err, projectId: this.projectId, attempt },
|
||||
'failed to get DEK, trying again'
|
||||
)
|
||||
await setTimeout(RETRY_DELAY_MS)
|
||||
const jitter = Math.random() * RETRY_DELAY_MS
|
||||
await setTimeout(RETRY_DELAY_MS + jitter)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user