aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2020-04-17 11:40:23 +0100
committerChristopher Baines <mail@cbaines.net>2020-04-17 11:40:23 +0100
commit6e7cb34bdef6d5090d57ea15690c9f0a06be7504 (patch)
treed82c6cbb4d46adb9666104250785b629333824f2
parent6ddf31cfbb963faa61f078538e5890d6cb656467 (diff)
downloadbuild-coordinator-6e7cb34bdef6d5090d57ea15690c9f0a06be7504.tar
build-coordinator-6e7cb34bdef6d5090d57ea15690c9f0a06be7504.tar.gz
Copy a few SQlite options from Cuirass
They'll probably help.
-rw-r--r--.gitignore2
-rw-r--r--guix-build-coordinator/datastore/sqlite.scm14
2 files changed, 12 insertions, 4 deletions
diff --git a/.gitignore b/.gitignore
index 4000209..5080576 100644
--- a/.gitignore
+++ b/.gitignore
@@ -19,6 +19,8 @@ pre-inst-env
.local.envrc
*.db
+*.db-shm
+*.db-wal
scripts/guix-build-coordinator
scripts/guix-build-coordinator-agent
diff --git a/guix-build-coordinator/datastore/sqlite.scm b/guix-build-coordinator/datastore/sqlite.scm
index 76b691b..431f74c 100644
--- a/guix-build-coordinator/datastore/sqlite.scm
+++ b/guix-build-coordinator/datastore/sqlite.scm
@@ -49,10 +49,16 @@
(slot-set!
datastore
'worker-thread-channel
- (make-worker-thread-channel (lambda ()
- (list (db-open database-file)))
- #:parallelism
- (min (current-processor-count) 4)))
+ (make-worker-thread-channel
+ (lambda ()
+ (let ((db
+ (db-open database-file)))
+ (sqlite-exec db "PRAGMA journal_mode=WAL;")
+ (sqlite-exec db "PRAGMA busy_timeout = 5000;")
+ (list db)))
+
+ #:parallelism
+ (min (current-processor-count) 4)))
datastore))