From bac123ddd9eaecb9044f7d7c9572f77825a18ad5 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 30 May 2016 14:53:57 +0200 Subject: Test the NAR info cache --- src/libstore/local-binary-cache-store.cc | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/libstore/local-binary-cache-store.cc') diff --git a/src/libstore/local-binary-cache-store.cc b/src/libstore/local-binary-cache-store.cc index e979a94b7aca..b418c9c04148 100644 --- a/src/libstore/local-binary-cache-store.cc +++ b/src/libstore/local-binary-cache-store.cc @@ -1,5 +1,6 @@ #include "binary-cache-store.hh" #include "globals.hh" +#include "nar-info-disk-cache.hh" namespace nix { @@ -16,6 +17,9 @@ public: : BinaryCacheStore(params) , binaryCacheDir(binaryCacheDir) { + /* For testing the NAR info cache. */ + if (getEnv("_NIX_CACHE_FILE_URLS") == "1") + diskCache = getNarInfoDiskCache(); } void init() override; @@ -53,6 +57,9 @@ void LocalBinaryCacheStore::init() { createDirs(binaryCacheDir + "/nar"); BinaryCacheStore::init(); + + if (diskCache && !diskCache->cacheExists(getUri())) + diskCache->createCache(getUri(), wantMassQuery_, priority); } static void atomicWrite(const Path & path, const std::string & s) -- cgit 1.4.1