aboutsummaryrefslogtreecommitdiff
path: root/nar-herder/storage.scm
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2021-12-15 00:51:30 +0000
committerChristopher Baines <mail@cbaines.net>2021-12-15 00:51:30 +0000
commitc45047a2580803fff42a9d2b1afc6d1ee2e793e0 (patch)
tree222a8918e4975ebb8a1f93389a6302d801750c31 /nar-herder/storage.scm
parent18fcfc638cc95ed25ce06ca4670be5fb7c71cc6d (diff)
downloadnar-herder-c45047a2580803fff42a9d2b1afc6d1ee2e793e0.tar
nar-herder-c45047a2580803fff42a9d2b1afc6d1ee2e793e0.tar.gz
Move retry for fetching files to a better place
Diffstat (limited to 'nar-herder/storage.scm')
-rw-r--r--nar-herder/storage.scm14
1 files changed, 8 insertions, 6 deletions
diff --git a/nar-herder/storage.scm b/nar-herder/storage.scm
index 37f63de..ef5ff27 100644
--- a/nar-herder/storage.scm
+++ b/nar-herder/storage.scm
@@ -229,11 +229,9 @@
(call-with-values
(lambda ()
- (retry-on-error
- (lambda ()
- (http-get uri
- #:decode-body? #f
- #:streaming? #t))))
+ (http-get uri
+ #:decode-body? #f
+ #:streaming? #t))
(lambda (response body)
(unless (= (response-code response)
200)
@@ -266,7 +264,11 @@
(< (+ storage-size file-bytes)
storage-limit))
(begin
- (fetch-file (assq-ref file 'url))
+ (retry-on-error
+ (lambda ()
+ (fetch-file (assq-ref file 'url)))
+ #:times 3
+ #:delay 5)
(loop (+ storage-size file-bytes)
(cdr missing-nar-files)))
;; This file won't fit, so try the next one