commit 0c6417192af62188c5c3d5c061e89eb453d23dc9 parent c3174c2d03aa2de3eedc37424c1f05c82119bbfa Author: Natasha Kerensikova <natgh@instinctive.eu> Date: Sun, 9 Aug 2026 17:04:17 +0000 Use WAL mode and busy timeout everywhere Diffstat:
| M | src/cgi.scm | | | 6 | +++++- |
| M | src/get-gruiks.scm | | | 5 | +++-- |
| M | src/iens.scm | | | 6 | +++++- |
3 files changed, 13 insertions(+), 4 deletions(-)
diff --git a/src/cgi.scm b/src/cgi.scm @@ -288,7 +288,11 @@ END-OF-CSS (else (string-append raw "/"))))) (define db (open-database db-name)) -(exec (sql/transient db "PRAGMA foreign_keys = ON;")) +(exec (sql/transient db "PRAGMA foreign_keys = ON; + PRAGMA journal_mode = WAL; + PRAGMA synchronous = NORMAL; + PRAGMA busy_timeout = 5000;")) +(set-busy-handler! db (busy-timeout 10000)) (include "common.scm") diff --git a/src/get-gruiks.scm b/src/get-gruiks.scm @@ -42,9 +42,10 @@ (define db (open-database db-name)) (exec (sql/transient db "PRAGMA foreign_keys = ON; + PRAGMA journal_mode = WAL; + PRAGMA synchronous = NORMAL; PRAGMA busy_timeout = 5000;")) -; PRAGMA journal_mode = WAL; -; PRAGMA synchronous = NORMAL; +(set-busy-handler! db (busy-timeout 10000)) (include "common.scm") diff --git a/src/iens.scm b/src/iens.scm @@ -96,7 +96,11 @@ (define db (open-database db-name)) (write-line (conc "Using database " db-name " with SQLite " library-version)) -(exec (sql db "PRAGMA foreign_keys = ON;")) +(exec (sql/transient db "PRAGMA foreign_keys = ON; + PRAGMA journal_mode = WAL; + PRAGMA synchronous = NORMAL; + PRAGMA busy_timeout = 5000;")) +(set-busy-handler! db (busy-timeout 10000)) (include "common.scm")