aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2020-05-20 07:54:14 +0100
committerChristopher Baines <mail@cbaines.net>2020-05-20 07:55:43 +0100
commit6eef9bcf4778dccf423bd349d98dcdf55eacfbcf (patch)
tree16578eb66a96c51ffe3966df80ff1909c9d327a5 /scripts
parent7f01b56cd115090c6a49049dab74f57235047dee (diff)
downloadbuild-coordinator-6eef9bcf4778dccf423bd349d98dcdf55eacfbcf.tar
build-coordinator-6eef9bcf4778dccf423bd349d98dcdf55eacfbcf.tar.gz
Include retrying when submitting builds
Diffstat (limited to 'scripts')
-rw-r--r--scripts/guix-build-coordinator-queue-builds-from-guix-data-service.in41
1 files changed, 23 insertions, 18 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 a6665a3..12118de 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
@@ -30,6 +30,7 @@
(json)
(web uri)
(web client)
+ (guix-build-coordinator utils)
(guix-build-coordinator client-communication))
(define %guix-data-service-host "data.guix.gnu.org")
@@ -126,24 +127,28 @@
derivations))
(define* (submit-build derivation #:key (priority 0))
- (let ((response
- (send-submit-build-request
- "http://127.0.0.1:8746"
- derivation
- (list
- (string-append "https://" %guix-data-service-host))
- #f
- priority
- #t
- #t
- #t)))
- (let ((no-build-submitted-response
- (assoc-ref response "no-build-submitted")))
- (if no-build-submitted-response
- (simple-format #t "skipped: ~A\n"
- no-build-submitted-response)
- (simple-format #t "build submitted as ~A\n"
- (assoc-ref response "build-submitted"))))))
+ (retry-on-error
+ (lambda ()
+ (let ((response
+ (send-submit-build-request
+ "http://127.0.0.1:8746"
+ derivation
+ (list
+ (string-append "https://" %guix-data-service-host))
+ #f
+ priority
+ #t
+ #t
+ #t)))
+ (let ((no-build-submitted-response
+ (assoc-ref response "no-build-submitted")))
+ (if no-build-submitted-response
+ (simple-format #t "skipped: ~A\n"
+ no-build-submitted-response)
+ (simple-format #t "build submitted as ~A\n"
+ (assoc-ref response "build-submitted"))))))
+ #:times 6
+ #:delay 10))
(define (submit-builds-for-revision commit)
(simple-format #t "looking at revision ~A\n" commit)