Skip to main content

Module package_download

Module package_download 

Source
Expand description

Fetching a package into the cache. A payload enters the cache only after its sha256 matched the manifest, so nothing downstream verifies it again.

StructsΒ§

Failure πŸ”’
One attempt’s failure, and whether another attempt could succeed.

ConstantsΒ§

CANCEL_POLL_MS πŸ”’
How often a wait looks at Cancel.
RETRY_DELAYS_MS πŸ”’
The waits before the second and third attempts at one package.

FunctionsΒ§

download_retrying
download_to_cache, tried again after a failure a retry could fix (see HttpError::is_transient, plus a payload that arrived corrupted), waiting between attempts; on_retry hears why, for the run log.
download_to_cache πŸ”’
Streams package to a temp file while hashing it, then promotes the file to <sha>.zip and records the entry; any failure deletes the temp file.
fetch_verified πŸ”’
promote πŸ”’
Identical bytes another package already stored are kept and the temp file dropped.
wait πŸ”’
Sleeps milliseconds, giving up as soon as Cancel is pressed.