From 66adbdfd9743cccec5f7ca4992cf3a631bb22774 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 10 Aug 2016 16:06:33 +0200 Subject: 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...). --- src/libstore/download.hh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/libstore/download.hh') diff --git a/src/libstore/download.hh b/src/libstore/download.hh index efddc55281fe..1f6098759a2d 100644 --- a/src/libstore/download.hh +++ b/src/libstore/download.hh @@ -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, const string & url, bool unpack, const Hash & expectedHash = Hash()); - enum Error { NotFound, Forbidden, Misc }; + enum Error { NotFound, Forbidden, Misc, Transient }; }; ref makeDownloader(); -- cgit 1.4.1