about summary refs log tree commit diff
path: root/src/libstore/http-binary-cache-store.cc
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2016-06-01T13·15+0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2016-06-01T14·24+0200
commitcf198952d02aae5585e9bb895577b5b4e7b25707 (patch)
tree2161ec8760bf9d2ca64c14c1440e7db31bb1d1be /src/libstore/http-binary-cache-store.cc
parent7850d3d27910c30232dd09dd86ee8afdaad26b90 (diff)
HttpBinaryCacheStore: Fix caching of WantMassQuery
Also, test HttpBinaryCacheStore in addition to LocalBinaryCacheStore.
Diffstat (limited to 'src/libstore/http-binary-cache-store.cc')
-rw-r--r--src/libstore/http-binary-cache-store.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/libstore/http-binary-cache-store.cc b/src/libstore/http-binary-cache-store.cc
index 9587ac5474fb..da80b636c76c 100644
--- a/src/libstore/http-binary-cache-store.cc
+++ b/src/libstore/http-binary-cache-store.cc
@@ -39,7 +39,7 @@ public:
     void init() override
     {
         // FIXME: do this lazily?
-        if (!diskCache->cacheExists(cacheUri)) {
+        if (!diskCache->cacheExists(cacheUri, wantMassQuery_, priority)) {
             try {
                 BinaryCacheStore::init();
             } catch (UploadToHTTP &) {
@@ -95,7 +95,9 @@ static RegisterStoreImplementation regStore([](
     -> std::shared_ptr<Store>
 {
     if (std::string(uri, 0, 7) != "http://" &&
-        std::string(uri, 0, 8) != "https://") return 0;
+        std::string(uri, 0, 8) != "https://" &&
+        (getEnv("_NIX_FORCE_HTTP_BINARY_CACHE_STORE") != "1" || std::string(uri, 0, 7) != "file://")
+        ) return 0;
     auto store = std::make_shared<HttpBinaryCacheStore>(params, uri);
     store->init();
     return store;