From 2b676c6e13684f92b29a4f71308a4f305db9ec6a Mon Sep 17 00:00:00 2001 From: Graham Christensen Date: Sun, 20 Jul 2025 17:54:52 -0700 Subject: [PATCH] Revert "Use WAL mode for SQLite cache databases" --- src/libstore/sqlite.cc | 4 ++-- src/libutil/util.cc | 8 ++------ 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/libstore/sqlite.cc b/src/libstore/sqlite.cc index 04f514d66..55b967ed6 100644 --- a/src/libstore/sqlite.cc +++ b/src/libstore/sqlite.cc @@ -93,7 +93,7 @@ SQLite::~SQLite() void SQLite::isCache() { exec("pragma synchronous = off"); - exec("pragma main.journal_mode = wal"); + exec("pragma main.journal_mode = truncate"); } 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 = e.info().msg + .msg = HintFmt(e.what()) }); } diff --git a/src/libutil/util.cc b/src/libutil/util.cc index 23dafe8c9..c9cc80fef 100644 --- a/src/libutil/util.cc +++ b/src/libutil/util.cc @@ -190,10 +190,8 @@ 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, ANSI_RED "error (ignored):" ANSI_NORMAL " %s", e.what()); + printMsg(lvl, "error (ignored): %1%", e.what()); } } catch (...) { } } @@ -204,10 +202,8 @@ 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, ANSI_RED "error (ignored):" ANSI_NORMAL " %s", e.what()); + printMsg(lvl, "error (ignored): %1%", e.what()); } }