1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-07 22:33:57 +02:00

NarInfoDiskCacheImpl: Make dbPath a parameter

This allows testing with a clean database.

(cherry picked from commit 79f62d2dda)
This commit is contained in:
Robert Hensing 2023-01-30 21:04:19 +01:00 committed by github-actions[bot]
parent 7a67baf951
commit 80498bd923

View file

@ -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);