aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Hensing <robert@roberthensing.nl>2023-01-30 21:04:19 +0100
committerRobert Hensing <robert@roberthensing.nl>2023-02-07 23:34:36 +0100
commit79f62d2dda8603c1f2f471ce20557548db932296 (patch)
tree5e022b4e4a5fc65eb2751c0953aea1b969e94f5f
parent29f0b196f44d273a5a85637168348c8a2e057049 (diff)
NarInfoDiskCacheImpl: Make dbPath a parameter
This allows testing with a clean database.
-rw-r--r--src/libstore/nar-info-disk-cache.cc3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/libstore/nar-info-disk-cache.cc b/src/libstore/nar-info-disk-cache.cc
index 883f364e5..c460100de 100644
--- a/src/libstore/nar-info-disk-cache.cc
+++ b/src/libstore/nar-info-disk-cache.cc
@@ -84,11 +84,10 @@ public:
Sync<State> _state;
- NarInfoDiskCacheImpl()
+ NarInfoDiskCacheImpl(Path dbPath = getCacheDir() + "/nix/binary-cache-v6.sqlite")
{
auto state(_state.lock());
- Path dbPath = getCacheDir() + "/nix/binary-cache-v6.sqlite";
createDirs(dirOf(dbPath));
state->db = SQLite(dbPath);