From ce08a51755914201c3730f5dbceb3c7da771e766 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Fri, 15 Mar 2024 23:33:46 +0000 Subject: Add a definition of retry-on-error which uses the fibers sleep --- guix-build-coordinator/utils/fibers.scm | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'guix-build-coordinator/utils') 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)))) -- cgit v1.2.3