about summary refs log tree commit diff
path: root/src/libstore/download.hh
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2016-08-10T14·06+0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2016-08-10T16·08+0200
commit66adbdfd9743cccec5f7ca4992cf3a631bb22774 (patch)
treeeb7ca4053b49e3d5c320386cfeb4e51b850df431 /src/libstore/download.hh
parent9204ea7294bf35beacbecd468a3c9690780b7ca5 (diff)
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...).
Diffstat (limited to 'src/libstore/download.hh')
-rw-r--r--src/libstore/download.hh11
1 files changed, 6 insertions, 5 deletions
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> store, const string & url, bool unpack,
         const Hash & expectedHash = Hash());
 
-    enum Error { NotFound, Forbidden, Misc };
+    enum Error { NotFound, Forbidden, Misc, Transient };
 };
 
 ref<Downloader> makeDownloader();