aboutsummaryrefslogtreecommitdiff
path: root/guix-build-coordinator/datastore
diff options
context:
space:
mode:
Diffstat (limited to 'guix-build-coordinator/datastore')
-rw-r--r--guix-build-coordinator/datastore/sqlite.scm17
1 files changed, 11 insertions, 6 deletions
diff --git a/guix-build-coordinator/datastore/sqlite.scm b/guix-build-coordinator/datastore/sqlite.scm
index ac04362..1effb39 100644
--- a/guix-build-coordinator/datastore/sqlite.scm
+++ b/guix-build-coordinator/datastore/sqlite.scm
@@ -109,6 +109,7 @@
worker-reader-thread-channel
worker-reader-thread-proc-vector
worker-writer-thread-channel
+ worker-priority-writer-thread-channel
worker-writer-thread-proc-vector
metrics-registry)
@@ -199,6 +200,10 @@
(slot-set! datastore
'worker-writer-thread-channel
channel)
+ ;; This is changed in datastore-spawn-fibers
+ (slot-set! datastore
+ 'worker-priority-writer-thread-channel
+ channel)
(slot-set! datastore
'worker-writer-thread-proc-vector
proc-vector))
@@ -343,11 +348,11 @@ PRAGMA optimize;")
(datastore <sqlite-datastore>))
;; Queue messages to the writer thread, so that they're handled in a first
;; come first served manor
- (slot-set!
- datastore
- 'worker-writer-thread-channel
- (make-queueing-channel
- (slot-ref datastore 'worker-writer-thread-channel)))
+ (let ((high low (make-discrete-priority-queueing-channels
+ (slot-ref datastore 'worker-writer-thread-channel)
+ 2)))
+ (slot-set! datastore 'worker-priority-writer-thread-channel high)
+ (slot-set! datastore 'worker-writer-thread-channel low))
(spawn-fiber
(lambda ()
@@ -3177,7 +3182,7 @@ WHERE id = :id"
(datastore <sqlite-datastore>)
id)
(call-with-worker-thread
- (slot-ref datastore 'worker-writer-thread-channel)
+ (slot-ref datastore 'worker-priority-writer-thread-channel)
(lambda (db)
(let ((statement
(sqlite-prepare