1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-12-03 15:40:59 +01:00

NarInfoDiskCacheImpl: Make dbPath a parameter

This allows testing with a clean database.

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

View file

@ -84,11 +84,10 @@ public:
Sync<State> _state; Sync<State> _state;
NarInfoDiskCacheImpl() NarInfoDiskCacheImpl(Path dbPath = getCacheDir() + "/nix/binary-cache-v6.sqlite")
{ {
auto state(_state.lock()); auto state(_state.lock());
Path dbPath = getCacheDir() + "/nix/binary-cache-v6.sqlite";
createDirs(dirOf(dbPath)); createDirs(dirOf(dbPath));
state->db = SQLite(dbPath); state->db = SQLite(dbPath);