aboutsummaryrefslogtreecommitdiff
path: root/guix-build-coordinator
diff options
context:
space:
mode:
Diffstat (limited to 'guix-build-coordinator')
-rw-r--r--guix-build-coordinator/client-communication.scm16
-rw-r--r--guix-build-coordinator/datastore/sqlite.scm15
2 files changed, 30 insertions, 1 deletions
diff --git a/guix-build-coordinator/client-communication.scm b/guix-build-coordinator/client-communication.scm
index 124caab..2453800 100644
--- a/guix-build-coordinator/client-communication.scm
+++ b/guix-build-coordinator/client-communication.scm
@@ -369,6 +369,14 @@
((_ . val)
(string=? val "true"))
(#f 'unset))
+ #:priority->
+ (or (and=> (assq-ref query-parameters 'priority_gt)
+ string->number)
+ 'unset)
+ #:priority-<
+ (or (and=> (assq-ref query-parameters 'priority_lt)
+ string->number)
+ 'unset)
#:after-id
(assq-ref query-parameters 'after_id)
#:limit
@@ -580,6 +588,8 @@
(not-systems '())
(processed 'unset)
(canceled 'unset)
+ (priority-> 'unset)
+ (priority-< 'unset)
(after-id #f)
(limit 1000))
(let ((query-parameters
@@ -621,6 +631,12 @@
'("canceled=true")
'("canceled=false"))
'())
+ ,@(if (number? priority->)
+ (list (simple-format #f "priority_gt=~A" priority->))
+ '())
+ ,@(if (number? priority-<)
+ (list (simple-format #f "priority_lt=~A" priority-<))
+ '())
,@(if after-id
(list (string-append "after_id=" after-id))
'())
diff --git a/guix-build-coordinator/datastore/sqlite.scm b/guix-build-coordinator/datastore/sqlite.scm
index a6c93f3..bf90fc5 100644
--- a/guix-build-coordinator/datastore/sqlite.scm
+++ b/guix-build-coordinator/datastore/sqlite.scm
@@ -1736,6 +1736,8 @@ WHERE uuid = :uuid"
(not-systems '())
(processed 'unset)
(canceled 'unset)
+ (priority-> 'unset)
+ (priority-< 'unset)
(after-id #f)
(limit 1000))
(call-with-worker-thread
@@ -1817,8 +1819,11 @@ SELECT id FROM tags WHERE key = :key"
(not (null? not-tag-expressions))
(not (null? systems))
(not (null? not-systems))
+ (not (eq? priority-> 'unset))
+ (not (eq? priority-< 'unset))
(not (eq? processed 'unset))
- (not (eq? canceled 'unset))))
+ (not (eq? canceled 'unset))
+ after-id))
(statement
(sqlite-prepare
db
@@ -1865,6 +1870,14 @@ LEFT JOIN (
#f "derivations.system_id != ~A"
(db-system->system-id db system)))
not-systems)
+ (if (number? priority->)
+ (list
+ (simple-format #f "priority > ~A" priority->))
+ '())
+ (if (number? priority-<)
+ (list
+ (simple-format #f "priority < ~A" priority-<))
+ '())
(cond
((eq? processed #t) '("processed = 1"))
((eq? processed #f) '("processed = 0"))