diff options
author | Christopher Baines <mail@cbaines.net> | 2025-06-18 17:59:42 +0100 |
---|---|---|
committer | Christopher Baines <mail@cbaines.net> | 2025-06-18 17:59:42 +0100 |
commit | 49a3675c8624cd3078f10d87d2f0ad3348e65c1b (patch) | |
tree | 99e964acf4facc54b90060b20e077c7229e40a4d | |
parent | df99e2f56cb7353b1b3488472794944f83cb004c (diff) | |
download | qa-frontpage-49a3675c8624cd3078f10d87d2f0ad3348e65c1b.tar qa-frontpage-49a3675c8624cd3078f10d87d2f0ad3348e65c1b.tar.gz |
Retry fetching patches
Mostly in case of rate limiting for patchwork.
-rw-r--r-- | guix-qa-frontpage/manage-patch-branches.scm | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/guix-qa-frontpage/manage-patch-branches.scm b/guix-qa-frontpage/manage-patch-branches.scm index 3aec254..d1930dc 100644 --- a/guix-qa-frontpage/manage-patch-branches.scm +++ b/guix-qa-frontpage/manage-patch-branches.scm @@ -21,6 +21,8 @@ #:use-module ((guix build utils) #:select (with-directory-excursion)) #:use-module (knots) #:use-module (knots thread-pool) + #:use-module ((guix-build-coordinator utils fibers) + #:select (retry-on-error)) #:use-module (guix-qa-frontpage mumi) #:use-module (guix-qa-frontpage database) #:use-module (guix-qa-frontpage git-repository) @@ -213,13 +215,17 @@ (simple-format #t "Running git am --ignore-whitespace --empty=drop --3way \"~A.patch\" (~A)\n" id name) (let ((patch-file (simple-format #f "~A.patch" id))) - (call-with-output-file patch-file - (lambda (output) - (let ((port - size - (http-fetch - (string->uri (assoc-ref patch "mbox"))))) - (dump-port port output)))) + (retry-on-error + (lambda () + (call-with-output-file patch-file + (lambda (output) + (let ((port + size + (http-fetch + (string->uri (assoc-ref patch "mbox"))))) + (dump-port port output))))) + #:times 2 + #:delay-seconds 60) (simple-format #t "applying ~A\n" patch-file) (let* ((code |