fetch: client timeout, retry with backoff, url.JoinPath (closes #63)
check / check (push) Failing after 1s

fetch now makes every request through an http.Client with a time
limit, ten minutes by default and set with --timeout; the manifest
loader shares that default. A connection error, a timeout, or a 5xx
or 429 response is retried, up to five tries in all, after a random
wait whose limit doubles from one second, or after the wait the
server's Retry-After asks for, up to one minute. Each try of a file
starts a new temp file, so a retry never keeps a partial file; the
size and hash checks are unchanged. Manifest and file URLs are built
with URL.JoinPath, so a base URL with or without a trailing slash or
with a query string, and names that need escaping, all work.

Model: opus-5-5
This commit is contained in:
2026-10-04 12:18:02 +00:00
parent e412d20c20
commit 35d771b704
5 changed files with 541 additions and 66 deletions
+9 -1
View File
@@ -23,6 +23,7 @@ const (
cmdVersion = "version"
flagProgress = "progress"
flagTimeout = "timeout"
manifestArgsUsage = "[manifest file]"
@@ -346,7 +347,14 @@ func (mfa *CLIApp) fetchCommand() *cli.Command {
return mfa.fetchManifestOperation(c)
},
Flags: commonFlags(),
Flags: append(commonFlags(),
&cli.DurationFlag{
Name: flagTimeout,
Value: httpTimeout,
Usage: "Time limit for each HTTP request, including the download " +
"of its body",
},
),
}
}