aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2023-07-08 09:40:03 +0100
committerChristopher Baines <mail@cbaines.net>2023-07-08 09:40:03 +0100
commit888cb5648e0213664bea80c9b43ffd447a07e514 (patch)
treee8d6c0ef05c50b9bee3da967c3a09211d419a340
parent734adc125b797f45f871e05861328381ea3764c9 (diff)
downloadbuild-coordinator-888cb5648e0213664bea80c9b43ffd447a07e514.tar
build-coordinator-888cb5648e0213664bea80c9b43ffd447a07e514.tar.gz
Add some retrying when performing bulk operations
-rw-r--r--scripts/guix-build-coordinator.in34
1 files changed, 21 insertions, 13 deletions
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)