When a job fails, respect the Retry-After
header if applicable
This commit is contained in:
parent
c7873dd7ea
commit
1f45bce0a2
12 changed files with 228 additions and 30 deletions
|
@ -90,11 +90,12 @@ export async function runReadOrViewSyncJob({
|
|||
return;
|
||||
}
|
||||
|
||||
const timeRemaining = timestamp + maxRetryTime - Date.now();
|
||||
|
||||
const shouldContinue = await commonShouldJobContinue({
|
||||
attempt,
|
||||
log,
|
||||
maxRetryTime,
|
||||
timestamp,
|
||||
timeRemaining,
|
||||
});
|
||||
if (!shouldContinue) {
|
||||
return;
|
||||
|
@ -117,6 +118,6 @@ export async function runReadOrViewSyncJob({
|
|||
})
|
||||
);
|
||||
} catch (err: unknown) {
|
||||
handleCommonJobRequestError(err, log);
|
||||
await handleCommonJobRequestError({ err, log, timeRemaining });
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue