aboutsummaryrefslogtreecommitdiff
path: root/guix-build-coordinator/utils
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2024-03-15 23:33:46 +0000
committerChristopher Baines <mail@cbaines.net>2024-03-15 23:33:46 +0000
commitce08a51755914201c3730f5dbceb3c7da771e766 (patch)
treeedbb2cbcaca8342c0111ea3da11e585f66137e11 /guix-build-coordinator/utils
parentb36ee4fd4cdcc94dd41f142b2058c8bbe032f497 (diff)
downloadbuild-coordinator-ce08a51755914201c3730f5dbceb3c7da771e766.tar
build-coordinator-ce08a51755914201c3730f5dbceb3c7da771e766.tar.gz
Add a definition of retry-on-error which uses the fibers sleep
Diffstat (limited to 'guix-build-coordinator/utils')
-rw-r--r--guix-build-coordinator/utils/fibers.scm11
1 files changed, 10 insertions, 1 deletions
diff --git a/guix-build-coordinator/utils/fibers.scm b/guix-build-coordinator/utils/fibers.scm
index 938d06f..965948a 100644
--- a/guix-build-coordinator/utils/fibers.scm
+++ b/guix-build-coordinator/utils/fibers.scm
@@ -27,7 +27,8 @@
letpar&
with-fibers-timeout
- with-fibers-port-timeouts))
+ with-fibers-port-timeouts)
+ #:replace (retry-on-error))
(define %worker-thread-args
(make-parameter #f))
@@ -524,3 +525,11 @@ If already in the worker thread, call PROC immediately."
(make-port-write-timeout-error thunk port))))))
(no-fibers-wait port "w" write-timeout)))))
(thunk)))
+
+;; Use the fibers sleep
+(define (retry-on-error . args)
+ (apply
+ (@ (guix-build-coordinator utils) retry-on-error)
+ (append
+ args
+ (list #:sleep sleep))))