From 62d75ad3e18a6ff8973fb95e7fbc58802c477eac Mon Sep 17 00:00:00 2001 From: AmineChikhaoui Date: Fri, 6 Apr 2018 11:05:15 +0100 Subject: [PATCH] rename the options to mention it's a narinfo TTL as disk cache is used all over the place for other operations --- src/libstore/globals.hh | 4 ++-- src/libstore/nar-info-disk-cache.cc | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/libstore/globals.hh b/src/libstore/globals.hh index 00147f615..7430bbedb 100644 --- a/src/libstore/globals.hh +++ b/src/libstore/globals.hh @@ -313,11 +313,11 @@ public: Setting trustedUsers{this, {"root"}, "trusted-users", "Which users or groups are trusted to ask the daemon to do unsafe things."}; - Setting ttlNegativeDiskCache{this, 3600, "negative-disk-cache-ttl", + Setting ttlNegativeNarInfoCache{this, 3600, "narinfo-cache-negative-ttl", "The TTL in seconds for negative lookups in the disk cache i.e binary cache lookups that " "return an invalid path result"}; - Setting ttlPositiveDiskCache{this, 30 * 24 * 3600, "positive-disk-cache-ttl", + Setting ttlPositiveNarInfoCache{this, 30 * 24 * 3600, "narinfo-cache-positive-ttl", "The TTL in seconds for positive lookups in the disk cache i.e binary cache lookups that " "return a valid path result."}; diff --git a/src/libstore/nar-info-disk-cache.cc b/src/libstore/nar-info-disk-cache.cc index 1e143736f..35403e5df 100644 --- a/src/libstore/nar-info-disk-cache.cc +++ b/src/libstore/nar-info-disk-cache.cc @@ -113,8 +113,8 @@ public: SQLiteStmt(state->db, "delete from NARs where ((present = 0 and timestamp < ?) or (present = 1 and timestamp < ?))") .use() - (now - settings.ttlNegativeDiskCache) - (now - settings.ttlPositiveDiskCache) + (now - settings.ttlNegativeNarInfoCache) + (now - settings.ttlPositiveNarInfoCache) .exec(); debug("deleted %d entries from the NAR info disk cache", sqlite3_changes(state->db)); @@ -183,8 +183,8 @@ public: auto queryNAR(state->queryNAR.use() (cache.id) (hashPart) - (now - settings.ttlNegativeDiskCache) - (now - settings.ttlPositiveDiskCache)); + (now - settings.ttlNegativeNarInfoCache) + (now - settings.ttlPositiveNarInfoCache)); if (!queryNAR.next()) return {oUnknown, 0};