Compare commits

..
1 Commits
Author SHA1 Message Date
clawbot f66d10ff76 quak backup retries failed requests for longer (closes #165)
check / check (push) Successful in 1m58s
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
2026-10-05 23:34:12 +00:00
2 changed files with 5 additions and 5 deletions
+2 -2
View File
@@ -432,8 +432,8 @@ With the defaults a file that is going to fail gives up after at most three and
a half seconds of waiting. `quak backup` usually runs from cron with nobody a half seconds of waiting. `quak backup` usually runs from cron with nobody
watching, so every request it makes uses the second column instead, exported as watching, so every request it makes uses the second column instead, exported as
`UNATTENDED_RETRY_OPTIONS`: a request that keeps failing gives up after at most `UNATTENDED_RETRY_OPTIONS`: a request that keeps failing gives up after at most
243 seconds of waiting, and usually after about half that, since each wait is 243 seconds, about four minutes, of waiting, so an outage of a few minutes does
drawn at random below its ceiling. Every other command uses the defaults. A not fail files until the next run. Every other command uses the defaults. A
library user gets the same budget by passing `UNATTENDED_RETRY_OPTIONS` as library user gets the same budget by passing `UNATTENDED_RETRY_OPTIONS` as
`ApiClientOptions.retry`. `sleep` and `random` are injectable through the same `ApiClientOptions.retry`. `sleep` and `random` are injectable through the same
option, which is how the test suite exercises the whole policy without waiting. option, which is how the test suite exercises the whole policy without waiting.
+3 -3
View File
@@ -37,9 +37,9 @@ export const DEFAULT_RETRY_OPTIONS: ResolvedRetryOptions = {
random: Math.random, random: Math.random,
}; };
// For a run nobody is watching, such as `quak backup` from cron. A request that // For a run nobody is watching, such as `quak backup` from cron: it rides out
// keeps failing waits at most 243 s in all before it gives up, usually about // an outage of a few minutes instead of failing every file until the next run.
// half that, since each wait is drawn at random below its ceiling. // A request that keeps failing waits at most 243 s in all before it gives up.
export const UNATTENDED_RETRY_OPTIONS: ResolvedRetryOptions = { export const UNATTENDED_RETRY_OPTIONS: ResolvedRetryOptions = {
...DEFAULT_RETRY_OPTIONS, ...DEFAULT_RETRY_OPTIONS,
attempts: 10, attempts: 10,