aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2021-01-15 22:45:51 +0000
committerChristopher Baines <mail@cbaines.net>2021-01-15 22:45:51 +0000
commit8697a008ab16c2ea97279d6650affd4c771ddddc (patch)
tree2dd8c6be49c42b8aae2ec04a3ea19dcf250afd22
parent50271cadc164b13bc7a43d7d58e588346939fa66 (diff)
downloadbuild-coordinator-8697a008ab16c2ea97279d6650affd4c771ddddc.tar
build-coordinator-8697a008ab16c2ea97279d6650affd4c771ddddc.tar.gz
Move triggering allocations out of the http server
As this code should be in the coordinator.
-rw-r--r--guix-build-coordinator/agent-messaging/http/server.scm6
-rw-r--r--guix-build-coordinator/coordinator.scm10
2 files changed, 9 insertions, 7 deletions
diff --git a/guix-build-coordinator/agent-messaging/http/server.scm b/guix-build-coordinator/agent-messaging/http/server.scm
index fe393be..d02bc83 100644
--- a/guix-build-coordinator/agent-messaging/http/server.scm
+++ b/guix-build-coordinator/agent-messaging/http/server.scm
@@ -265,9 +265,6 @@ port. Also, the port used can be changed by passing the --port option.\n"
(handle-build-result build-coordinator
agent-id-for-build uuid
(json-string->scm (utf8->string body)))
- ;; Trigger build allocation, as the result of this build
- ;; could change the allocation
- (trigger-build-allocation build-coordinator)
(render-json
"message received"))
(render-json
@@ -295,9 +292,6 @@ port. Also, the port used can be changed by passing the --port option.\n"
build-coordinator
agent-id-for-build uuid
(json-string->scm (utf8->string body)))
- ;; Trigger build allocation, so that the allocator can handle
- ;; this setup failure
- (trigger-build-allocation build-coordinator)
(render-json
"message received"))
(render-json
diff --git a/guix-build-coordinator/coordinator.scm b/guix-build-coordinator/coordinator.scm
index ba5960e..349597f 100644
--- a/guix-build-coordinator/coordinator.scm
+++ b/guix-build-coordinator/coordinator.scm
@@ -709,6 +709,10 @@
'build-success
'build-failure))
+ ;; Trigger build allocation, as the result of this build
+ ;; could change the allocation
+ (trigger-build-allocation build-coordinator)
+
#t))))
(define (handle-build-start-report build-coordinator
@@ -742,4 +746,8 @@
(datastore-store-setup-failure datastore
build-id
agent-id
- failure-reason))))
+ failure-reason)))
+
+ ;; Trigger build allocation, so that the allocator can handle this setup
+ ;; failure
+ (trigger-build-allocation build-coordinator))