diff options
author | Christopher Baines <mail@cbaines.net> | 2022-10-10 20:56:49 +0100 |
---|---|---|
committer | Christopher Baines <mail@cbaines.net> | 2022-10-10 20:56:49 +0100 |
commit | 054658c5496a66d91a8b42f555298c745a7599f6 (patch) | |
tree | 6c25995b57972f1ac5f17d22c292b3bdcbdd29d0 /guix-build-coordinator | |
parent | ee089a9e48a569e61134ceff5ccf96b945fed8a7 (diff) | |
download | build-coordinator-054658c5496a66d91a8b42f555298c745a7599f6.tar build-coordinator-054658c5496a66d91a8b42f555298c745a7599f6.tar.gz |
Allow specifying the maximum number of allocated builds
For an agent.
Diffstat (limited to 'guix-build-coordinator')
-rw-r--r-- | guix-build-coordinator/agent.scm | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/guix-build-coordinator/agent.scm b/guix-build-coordinator/agent.scm index eb3ec3c..b589b65 100644 --- a/guix-build-coordinator/agent.scm +++ b/guix-build-coordinator/agent.scm @@ -64,6 +64,7 @@ coordinator-interface systems max-parallel-builds + max-allocated-builds max-parallel-uploads derivation-substitute-urls non-derivation-substitute-urls @@ -473,8 +474,11 @@ (while #t (let ((current-threads (count-threads)) (job-count (count-jobs))) - (if (or (< job-count current-threads) - (= job-count 0)) + (if (and (or (not max-allocated-builds) + (< (+ job-count (count-post-build-jobs)) + max-allocated-builds)) + (or (< job-count current-threads) + (= job-count 0))) (let* ((queued-build-ids (append (map (lambda (job-args) |