mirror of
https://github.com/NixOS/nix
synced 2025-07-04 19:41:48 +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
|
@ -9,10 +9,11 @@ namespace nix {
|
|||
|
||||
struct DownloadOptions
|
||||
{
|
||||
string expectedETag;
|
||||
bool verifyTLS{true};
|
||||
enum { yes, no, automatic } showProgress{yes};
|
||||
bool head{false};
|
||||
std::string expectedETag;
|
||||
bool verifyTLS = true;
|
||||
enum { yes, no, automatic } showProgress = yes;
|
||||
bool head = false;
|
||||
size_t tries = 1;
|
||||
};
|
||||
|
||||
struct DownloadResult
|
||||
|
@ -31,7 +32,7 @@ struct Downloader
|
|||
Path downloadCached(ref<Store> store, const string & url, bool unpack,
|
||||
const Hash & expectedHash = Hash());
|
||||
|
||||
enum Error { NotFound, Forbidden, Misc };
|
||||
enum Error { NotFound, Forbidden, Misc, Transient };
|
||||
};
|
||||
|
||||
ref<Downloader> makeDownloader();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue