mirror of
https://github.com/NixOS/nix
synced 2025-06-25 19:01:16 +02:00
HttpBinaryCacheStore: Retry on transient HTTP errors
This makes us more robust against 500 errors from CloudFront or S3 (assuming the 500 error isn't cached by CloudFront...).
This commit is contained in:
parent
9204ea7294
commit
66adbdfd97
3 changed files with 34 additions and 14 deletions
|
@ -58,6 +58,7 @@ protected:
|
|||
DownloadOptions options;
|
||||
options.showProgress = DownloadOptions::no;
|
||||
options.head = true;
|
||||
options.tries = 5;
|
||||
downloader->download(cacheUri + "/" + path, options);
|
||||
return true;
|
||||
} catch (DownloadError & e) {
|
||||
|
@ -79,6 +80,7 @@ protected:
|
|||
auto downloader(downloaders.get());
|
||||
DownloadOptions options;
|
||||
options.showProgress = DownloadOptions::no;
|
||||
options.tries = 3;
|
||||
try {
|
||||
return downloader->download(cacheUri + "/" + path, options).data;
|
||||
} catch (DownloadError & e) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue