quak backup retries failed requests for longer (closes #165)
check / check (push) Successful in 4m16s
check / check (push) Successful in 4m16s
src/retry.ts exports UNATTENDED_RETRY_OPTIONS beside the unchanged default: 10 attempts, a 1 s base delay and a 60 s cap, so a request that keeps failing waits at most 243 s before it gives up. bin/quak.ts loads the backup's session with them, so its refresh, ML data and downloads all use them; every other command keeps the default. What is retried and the backoff formula are unchanged. Model: opus-5-5
This commit was merged in pull request #174.
This commit is contained in:
@@ -27,6 +27,7 @@ export {
|
||||
isRetryable,
|
||||
isSafeToReplay,
|
||||
resolveRetryOptions,
|
||||
UNATTENDED_RETRY_OPTIONS,
|
||||
withRetry,
|
||||
type ResolvedRetryOptions,
|
||||
type RetryOptions,
|
||||
|
||||
@@ -37,6 +37,16 @@ export const DEFAULT_RETRY_OPTIONS: ResolvedRetryOptions = {
|
||||
random: Math.random,
|
||||
};
|
||||
|
||||
// For a run nobody is watching, such as `quak backup` from cron. A request that
|
||||
// keeps failing waits at most 243 s in all before it gives up, usually about
|
||||
// half that, since each wait is drawn at random below its ceiling.
|
||||
export const UNATTENDED_RETRY_OPTIONS: ResolvedRetryOptions = {
|
||||
...DEFAULT_RETRY_OPTIONS,
|
||||
attempts: 10,
|
||||
baseDelayMs: 1_000,
|
||||
maxDelayMs: 60_000,
|
||||
};
|
||||
|
||||
export const resolveRetryOptions = (
|
||||
opts?: RetryOptions,
|
||||
): ResolvedRetryOptions => ({
|
||||
|
||||
Reference in New Issue
Block a user