aboutsummaryrefslogtreecommitdiff
path: root/guix-build-coordinator/datastore
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2020-12-04 19:03:48 +0000
committerChristopher Baines <mail@cbaines.net>2020-12-04 19:03:48 +0000
commit7067f20261245d14508fddccb526c08551ce7861 (patch)
tree18e52c3492eec65508b52e76997e5bc85737ca52 /guix-build-coordinator/datastore
parent5c8cf7916078b2e65621472a044020eb27e5034f (diff)
downloadbuild-coordinator-7067f20261245d14508fddccb526c08551ce7861.tar
build-coordinator-7067f20261245d14508fddccb526c08551ce7861.tar.gz
Fix incorrect return value from datastore-allocate-builds-to-agent
In the case where max-builds is specified, and no new builds are allocated.
Diffstat (limited to 'guix-build-coordinator/datastore')
-rw-r--r--guix-build-coordinator/datastore/sqlite.scm7
1 files changed, 6 insertions, 1 deletions
diff --git a/guix-build-coordinator/datastore/sqlite.scm b/guix-build-coordinator/datastore/sqlite.scm
index 80dc813..2ae6f7b 100644
--- a/guix-build-coordinator/datastore/sqlite.scm
+++ b/guix-build-coordinator/datastore/sqlite.scm
@@ -2003,7 +2003,12 @@ WHERE agent_id = :agent_id"
(append initially-allocated-builds
new-builds)
new-builds))
- '())))
+ ;; Previously allocate builds just returned newly allocated builds,
+ ;; but if max-builds is provided, return all the builds. This means
+ ;; the agent can handle this in a idempotent manor.
+ (if max-builds
+ initially-allocated-builds
+ '()))))
#:duration-metric-name "allocate_builds_to_agent"))
(define-method (datastore-list-allocation-plan-builds