about summary refs log tree commit diff
path: root/src/libstore/globals.hh
diff options
context:
space:
mode:
authorAmineChikhaoui <amine.chikhaoui91@gmail.com>2018-04-02T11·45+0100
committerAmineChikhaoui <amine.chikhaoui91@gmail.com>2018-04-06T09·51+0100
commit2855c3d965bab5e88c4cd08dc3a92e705ff5ac9f (patch)
treec70afcb31a305e02c442560d67fb9b0716cdcd32 /src/libstore/globals.hh
parent27e9ce0eb2662762f019241b89b6687e9f6715fe (diff)
Make the TTL for disk cache configurable, we can now completely disable
disk cache lookup for example by doing:
  nix copy --from <binary-cahe> <store-path> --option \
  positive-disk-cache-ttl 0

Issues: #1885 #2035
Diffstat (limited to 'src/libstore/globals.hh')
-rw-r--r--src/libstore/globals.hh6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/libstore/globals.hh b/src/libstore/globals.hh
index 117404ec14c8..36c8b7357904 100644
--- a/src/libstore/globals.hh
+++ b/src/libstore/globals.hh
@@ -310,6 +310,12 @@ public:
         "Disabled substituters that may be enabled via the substituters option by untrusted users.",
         {"trusted-binary-caches"}};
 
+    Setting<int> ttlNegativeDiskCache{this, 3600, "negative-disk-cache-ttl",
+        "The TTL in seconds for negative lookups in the disk cache."};
+
+    Setting<int> ttlPositiveDiskCache{this, 30 * 24 * 3600, "positive-disk-cache-ttl",
+        "The TTL in seconds for positive lookups in the disk cache."};
+
     Setting<Strings> trustedUsers{this, {"root"}, "trusted-users",
         "Which users or groups are trusted to ask the daemon to do unsafe things."};