quak backup retries failed requests for longer (closes #165)
check / check (push) Successful in 2m7s
check / check (push) Successful in 2m7s
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 is contained in:
+14
-1
@@ -23,6 +23,7 @@ import { run as runCommand } from "../src/cli-run.js";
|
||||
import { loadSession } from "../src/cli-session.js";
|
||||
import { Client } from "../src/client.js";
|
||||
import { VERSION } from "../src/index.js";
|
||||
import { UNATTENDED_RETRY_OPTIONS } from "../src/retry.js";
|
||||
|
||||
const paths = envPaths("quak", { suffix: "" });
|
||||
|
||||
@@ -129,8 +130,20 @@ program
|
||||
)
|
||||
.argument("<dir>", "Output directory")
|
||||
.option("--json", "Print result as JSON instead of human-readable summary")
|
||||
// A backup usually runs from cron with nobody watching, so every request
|
||||
// it makes retries for longer than the other commands' requests do.
|
||||
.action((dir: string, opts: { json?: boolean }) =>
|
||||
run(backupCommand(context(), dir, opts)),
|
||||
run(
|
||||
backupCommand(
|
||||
{
|
||||
...context(),
|
||||
loadSession: (path) =>
|
||||
loadSession(path, { retry: UNATTENDED_RETRY_OPTIONS }),
|
||||
},
|
||||
dir,
|
||||
opts,
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
const helper = program
|
||||
|
||||
Reference in New Issue
Block a user