diff options
author | Christopher Baines <mail@cbaines.net> | 2020-04-17 11:40:23 +0100 |
---|---|---|
committer | Christopher Baines <mail@cbaines.net> | 2020-04-17 11:40:23 +0100 |
commit | 6e7cb34bdef6d5090d57ea15690c9f0a06be7504 (patch) | |
tree | d82c6cbb4d46adb9666104250785b629333824f2 | |
parent | 6ddf31cfbb963faa61f078538e5890d6cb656467 (diff) | |
download | build-coordinator-6e7cb34bdef6d5090d57ea15690c9f0a06be7504.tar build-coordinator-6e7cb34bdef6d5090d57ea15690c9f0a06be7504.tar.gz |
Copy a few SQlite options from Cuirass
They'll probably help.
-rw-r--r-- | .gitignore | 2 | ||||
-rw-r--r-- | guix-build-coordinator/datastore/sqlite.scm | 14 |
2 files changed, 12 insertions, 4 deletions
@@ -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)) |