forked from lix-project/lix
Move loadConfFile() to initLibStore
Part of an effort to make it easier to initialize the right things, by moving code into the appropriate libraries. Using libstore without loading the config file is risky, as sqlite may then be misconfigured. See https://github.com/cachix/cachix/issues/475
This commit is contained in:
parent
6e0b7109ab
commit
a692c43729
|
@ -27,7 +27,6 @@ static ref<Store> store()
|
||||||
if (!_store) {
|
if (!_store) {
|
||||||
try {
|
try {
|
||||||
initLibStore();
|
initLibStore();
|
||||||
loadConfFile();
|
|
||||||
settings.lockCPU = false;
|
settings.lockCPU = false;
|
||||||
_store = openStore();
|
_store = openStore();
|
||||||
} catch (Error & e) {
|
} catch (Error & e) {
|
||||||
|
|
|
@ -166,8 +166,6 @@ void initNix()
|
||||||
if (sodium_init() == -1)
|
if (sodium_init() == -1)
|
||||||
throw Error("could not initialise libsodium");
|
throw Error("could not initialise libsodium");
|
||||||
|
|
||||||
loadConfFile();
|
|
||||||
|
|
||||||
startSignalHandlerThread();
|
startSignalHandlerThread();
|
||||||
|
|
||||||
/* Reset SIGCHLD to its default. */
|
/* Reset SIGCHLD to its default. */
|
||||||
|
|
|
@ -291,6 +291,9 @@ void assertLibStoreInitialized() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void initLibStore() {
|
void initLibStore() {
|
||||||
|
|
||||||
|
loadConfFile();
|
||||||
|
|
||||||
initLibStoreDone = true;
|
initLibStoreDone = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue