aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--scripts/guix-build-coordinator-queue-builds-from-guix-data-service.in25
1 files changed, 15 insertions, 10 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 0adb64c..9536fed 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
@@ -29,6 +29,7 @@
(srfi srfi-11)
(srfi srfi-37)
(ice-9 match)
+ (ice-9 threads)
(ice-9 textual-ports)
(rnrs bytevectors)
(json)
@@ -142,11 +143,12 @@
(assoc-ref data "derivations")))))
(define (record-derivations-as-processed derivations)
- (for-each (lambda (derivation)
- (hash-set! processed-derivations-hash
- derivation
- #t))
- derivations))
+ (monitor
+ (for-each (lambda (derivation)
+ (hash-set! processed-derivations-hash
+ derivation
+ #t))
+ derivations)))
(define* (submit-build coordinator guix-data-service derivation #:key (priority 0))
(retry-on-error
@@ -196,7 +198,7 @@
#:key (submit-builds-for-channel-instances?
#t))
(simple-format #t "looking at revision ~A\n" commit)
- (for-each
+ (par-for-each
(match-lambda
((system . target)
(when (string=? target "none")
@@ -216,10 +218,13 @@
(let ((unprocessed-package-derivations
(filter (lambda (derivation)
(not (hash-ref processed-derivations-hash derivation)))
- (package-derivations-for-commit guix-data-service
- commit
- #:system system
- #:target target))))
+ ;; Only request derivations in one thread at a time, just
+ ;; in cause doing this in parallel could lead to timeouts
+ (monitor
+ (package-derivations-for-commit guix-data-service
+ commit
+ #:system system
+ #:target target)))))
(for-each (lambda (derivation)
(submit-build coordinator