diff options
-rw-r--r-- | scripts/guix-build-coordinator-queue-builds-from-guix-data-service.in | 48 |
1 files changed, 29 insertions, 19 deletions
diff --git a/scripts/guix-build-coordinator-queue-builds-from-guix-data-service.in b/scripts/guix-build-coordinator-queue-builds-from-guix-data-service.in index dc28008..c70c892 100644 --- a/scripts/guix-build-coordinator-queue-builds-from-guix-data-service.in +++ b/scripts/guix-build-coordinator-queue-builds-from-guix-data-service.in @@ -292,6 +292,11 @@ (or (assq-ref result 'branches) '())) (alist-delete 'branches result)))) + (option '("priority") #t #f + (lambda (opt name arg result) + (alist-cons 'priority + (string->number arg) + (alist-delete 'priority result)))) (option '("threads") #t #f (lambda (opt name arg result) (alist-cons 'threads @@ -346,25 +351,30 @@ lvl str))))) - (define (priority-for-derivation type system target) - (cond - ((eq? type 'channel-instance) - (if (and (string=? system "x86_64-linux") - (string=? target "none")) - 1000 - 500)) - ((eq? type 'package) - (cond - ((and (string=? system "x86_64-linux") - (string=? target "none")) - 500) - ((and (string=? system "aarch64-linux") - (string=? target "none")) - 500) - (else - 0))) - (else - 0))) + (define priority-for-derivation + (or (and=> (assq-ref opts 'priority) + (lambda (fixed-priority) + (const fixed-priority))) + + (lambda (type system target) + (cond + ((eq? type 'channel-instance) + (if (and (string=? system "x86_64-linux") + (string=? target "none")) + 1000 + 500)) + ((eq? type 'package) + (cond + ((and (string=? system "x86_64-linux") + (string=? target "none")) + 500) + ((and (string=? system "aarch64-linux") + (string=? target "none")) + 500) + (else + 0))) + (else + 0))))) (add-handler! lgr port-log) (open-log! lgr) |