diff options
Diffstat (limited to 'guix-build-coordinator/datastore')
-rw-r--r-- | guix-build-coordinator/datastore/sqlite.scm | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/guix-build-coordinator/datastore/sqlite.scm b/guix-build-coordinator/datastore/sqlite.scm index 7c9b4d0..1bc4aa0 100644 --- a/guix-build-coordinator/datastore/sqlite.scm +++ b/guix-build-coordinator/datastore/sqlite.scm @@ -1187,6 +1187,7 @@ WHERE uuid = :uuid" (not-tags '()) (processed 'unset) (canceled 'unset) + (after-id #f) (limit 1000)) (call-with-worker-thread (slot-ref datastore 'worker-reader-thread-channel) @@ -1268,15 +1269,24 @@ INNER JOIN ( (cond ((eq? canceled #t) '("canceled = 1")) ((eq? canceled #f) '("canceled = 0")) - (else '()))) + (else '())) + (if after-id + '("uuid > :after_id") + '())) " AND ") "\n") "") + "ORDER BY uuid ASC\n" (if limit (string-append "LIMIT " (number->string limit) "\n") "")) #:cache? #f))) + (when after-id + (sqlite-bind-arguments + statement + #:after_id after-id)) + (let ((result (sqlite-map (match-lambda |