From 79f62d2dda8603c1f2f471ce20557548db932296 Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Mon, 30 Jan 2023 21:04:19 +0100 Subject: [PATCH] NarInfoDiskCacheImpl: Make dbPath a parameter This allows testing with a clean database. --- src/libstore/nar-info-disk-cache.cc | 3 +-- 1 file changed, 1 insertion(+), 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; - 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);