aboutsummaryrefslogtreecommitdiff
path: root/guix-build-coordinator/datastore
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2023-04-24 09:04:17 +0100
committerChristopher Baines <mail@cbaines.net>2023-04-24 09:04:17 +0100
commit579ac66fcb263bd3a9086c264847abf748c02a40 (patch)
treeb325009904040f29c62a34a49990f8be9b72c776 /guix-build-coordinator/datastore
parent28d0ca2690bfb01f6dea0e79cc4d28fdfa23b4b0 (diff)
downloadbuild-coordinator-579ac66fcb263bd3a9086c264847abf748c02a40.tar
build-coordinator-579ac66fcb263bd3a9086c264847abf748c02a40.tar.gz
Make sure the writer thread sets up before the reader threads
Diffstat (limited to 'guix-build-coordinator/datastore')
-rw-r--r--guix-build-coordinator/datastore/sqlite.scm6
1 files changed, 6 insertions, 0 deletions
diff --git a/guix-build-coordinator/datastore/sqlite.scm b/guix-build-coordinator/datastore/sqlite.scm
index 5772402..8b209b7 100644
--- a/guix-build-coordinator/datastore/sqlite.scm
+++ b/guix-build-coordinator/datastore/sqlite.scm
@@ -192,6 +192,12 @@ CREATE TABLE IF NOT EXISTS mem.build_allocation_plan (
"warning: database write delayed by ~1,2f seconds~%"
seconds-delayed))))))
+ ;; Make sure the worker thread has initialised, and created the in memory
+ ;; tables
+ (call-with-worker-thread
+ (slot-ref datastore 'worker-writer-thread-channel)
+ (const #t))
+
(slot-set!
datastore
'worker-reader-thread-channel