about summary refs log tree commit diff
path: root/src/libstore/download.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstore/download.cc')
-rw-r--r--src/libstore/download.cc11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/libstore/download.cc b/src/libstore/download.cc
index 95c7d2255afc..5305a48950c4 100644
--- a/src/libstore/download.cc
+++ b/src/libstore/download.cc
@@ -230,7 +230,7 @@ struct CurlDownloader : public Downloader
             } catch (DownloadError & e) {
                 attempt++;
                 if (e.error != Transient || attempt >= options.tries) throw;
-                auto ms = 25 * (1 << (attempt - 1));
+                auto ms = options.baseRetryTimeMs * (1 << (attempt - 1));
                 printMsg(lvlError, format("warning: %s; retrying in %d ms") % e.what() % ms);
                 std::this_thread::sleep_for(std::chrono::milliseconds(ms));
             }
@@ -243,13 +243,14 @@ ref<Downloader> makeDownloader()
     return make_ref<CurlDownloader>();
 }
 
-Path Downloader::downloadCached(ref<Store> store, const string & url_, bool unpack, const Hash & expectedHash)
+Path Downloader::downloadCached(ref<Store> store, const string & url_, bool unpack, string name, const Hash & expectedHash)
 {
     auto url = resolveUri(url_);
 
-    string name;
-    auto p = url.rfind('/');
-    if (p != string::npos) name = string(url, p + 1);
+    if (name == "") {
+        auto p = url.rfind('/');
+        if (p != string::npos) name = string(url, p + 1);
+    }
 
     Path expectedStorePath;
     if (expectedHash) {