diff options
author | Christopher Baines <mail@cbaines.net> | 2020-12-16 06:06:40 +0000 |
---|---|---|
committer | Christopher Baines <mail@cbaines.net> | 2020-12-16 06:06:40 +0000 |
commit | 76b32425f82caa8343d66f18a87a2caf65cdb610 (patch) | |
tree | 8664058baf20b8d3e90dccc2bcf549c89fcd300f | |
parent | 8082cc72316bb54a99f6749b9a80bbf207ba61f6 (diff) | |
download | build-coordinator-76b32425f82caa8343d66f18a87a2caf65cdb610.tar build-coordinator-76b32425f82caa8343d66f18a87a2caf65cdb610.tar.gz |
Move setting the journal_mode earlier in the database setup
This avoids an error when it happens on one of the readonly reader
connections. I believe this value is persistent, so it's unnecessary to set it
for each connection.
-rw-r--r-- | guix-build-coordinator/datastore/sqlite.scm | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/guix-build-coordinator/datastore/sqlite.scm b/guix-build-coordinator/datastore/sqlite.scm index fad86a3..d7676b5 100644 --- a/guix-build-coordinator/datastore/sqlite.scm +++ b/guix-build-coordinator/datastore/sqlite.scm @@ -87,6 +87,7 @@ (run-sqitch database-file)) (let ((db (db-open database-file))) + (sqlite-exec db "PRAGMA journal_mode=WAL;") (sqlite-exec db "PRAGMA optimize;") (sqlite-exec db "PRAGMA wal_checkpoint(TRUNCATE);") (sqlite-close db)) @@ -103,7 +104,6 @@ (lambda () (let ((db (db-open database-file #:write? #f))) - (sqlite-exec db "PRAGMA journal_mode=WAL;") (sqlite-exec db "PRAGMA busy_timeout = 5000;") (list db))) @@ -136,7 +136,6 @@ (lambda () (let ((db (db-open database-file))) - (sqlite-exec db "PRAGMA journal_mode=WAL;") (sqlite-exec db "PRAGMA busy_timeout = 5000;") (list db))) |