1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-18 16:29:36 +01:00

Merge pull request #150 from DeterminateSystems/concurrent-eval-cache

Use WAL mode for SQLite cache databases
This commit is contained in:
Graham Christensen 2025-07-16 13:39:01 +00:00 committed by GitHub
commit c299fba405
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 4 deletions

View file

@ -93,7 +93,7 @@ SQLite::~SQLite()
void SQLite::isCache()
{
exec("pragma synchronous = off");
exec("pragma main.journal_mode = truncate");
exec("pragma main.journal_mode = wal");
}
void SQLite::exec(const std::string & stmt)
@ -250,7 +250,7 @@ void handleSQLiteBusy(const SQLiteBusy & e, time_t & nextWarning)
if (now > nextWarning) {
nextWarning = now + 10;
logWarning({
.msg = HintFmt(e.what())
.msg = e.info().msg
});
}

View file

@ -190,8 +190,10 @@ void ignoreExceptionInDestructor(Verbosity lvl)
try {
try {
throw;
} catch (Error & e) {
printMsg(lvl, ANSI_RED "error (ignored):" ANSI_NORMAL " %s", e.info().msg);
} catch (std::exception & e) {
printMsg(lvl, "error (ignored): %1%", e.what());
printMsg(lvl, ANSI_RED "error (ignored):" ANSI_NORMAL " %s", e.what());
}
} catch (...) { }
}
@ -202,8 +204,10 @@ void ignoreExceptionExceptInterrupt(Verbosity lvl)
throw;
} catch (const Interrupted & e) {
throw;
} catch (Error & e) {
printMsg(lvl, ANSI_RED "error (ignored):" ANSI_NORMAL " %s", e.info().msg);
} catch (std::exception & e) {
printMsg(lvl, "error (ignored): %1%", e.what());
printMsg(lvl, ANSI_RED "error (ignored):" ANSI_NORMAL " %s", e.what());
}
}