From 6eef9bcf4778dccf423bd349d98dcdf55eacfbcf Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Wed, 20 May 2020 07:54:14 +0100 Subject: Include retrying when submitting builds --- ...rdinator-queue-builds-from-guix-data-service.in | 41 ++++++++++++---------- 1 file changed, 23 insertions(+), 18 deletions(-) (limited to 'scripts') 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) -- cgit v1.2.3