From 888cb5648e0213664bea80c9b43ffd447a07e514 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Sat, 8 Jul 2023 09:40:03 +0100 Subject: Add some retrying when performing bulk operations --- scripts/guix-build-coordinator.in | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) (limited to 'scripts') diff --git a/scripts/guix-build-coordinator.in b/scripts/guix-build-coordinator.in index 2eea161..9aa4749 100644 --- a/scripts/guix-build-coordinator.in +++ b/scripts/guix-build-coordinator.in @@ -642,14 +642,18 @@ tags: (for-each (lambda (id) (let ((result - (send-cancel-build-request - (assq-ref opts 'coordinator) - id - #:skip-updating-derived-priorities? - (assq-ref opts 'skip-updating-derived-priorities) - #:ignore-if-build-required-by-another? - (assq-ref - opts 'ignore-if-build-required-by-another)))) + (retry-on-error + (lambda () + (send-cancel-build-request + (assq-ref opts 'coordinator) + id + #:skip-updating-derived-priorities? + (assq-ref opts 'skip-updating-derived-priorities) + #:ignore-if-build-required-by-another? + (assq-ref + opts 'ignore-if-build-required-by-another))) + #:times 6 + #:delay 5))) (unless (string=? (assoc-ref result "result") "build-canceled") (simple-format #t "~A\n" @@ -714,11 +718,15 @@ tags: (current-error-port)) (lambda (report) (for-each (lambda (id) - (send-update-build-priority-request - (assq-ref opts 'coordinator) - id - (assq-ref opts 'new-priority)) - (report)) + (retry-on-error + (lambda () + (send-update-build-priority-request + (assq-ref opts 'coordinator) + id + (assq-ref opts 'new-priority)) + (report)) + #:times 6 + #:delay 5)) matching-builds))))) ((build-id) (send-update-build-priority-request (assq-ref opts 'coordinator) -- cgit v1.2.3