aboutsummaryrefslogtreecommitdiff
path: root/nar-herder/storage.scm
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2021-12-15 00:26:34 +0000
committerChristopher Baines <mail@cbaines.net>2021-12-15 00:26:34 +0000
commit631f9466cd91708c3b738e3cfb85be9f909cbbd0 (patch)
tree47069d2a05b31f2799d3dc17a999dda34e73efab /nar-herder/storage.scm
parentff809dcba6dd5da637a1a371dcf68b22bc9375ed (diff)
downloadnar-herder-631f9466cd91708c3b738e3cfb85be9f909cbbd0.tar
nar-herder-631f9466cd91708c3b738e3cfb85be9f909cbbd0.tar.gz
Add some retrying around requests
Diffstat (limited to 'nar-herder/storage.scm')
-rw-r--r--nar-herder/storage.scm14
1 files changed, 10 insertions, 4 deletions
diff --git a/nar-herder/storage.scm b/nar-herder/storage.scm
index 88f19ea..37f63de 100644
--- a/nar-herder/storage.scm
+++ b/nar-herder/storage.scm
@@ -142,7 +142,11 @@
".narinfo/info"))))
(call-with-values
(lambda ()
- (http-get uri #:decode-body? #f))
+ (retry-on-error
+ (lambda ()
+ (http-get uri #:decode-body? #f))
+ #:times 3
+ #:delay 5))
(lambda (response body)
(and (= (response-code response)
200)
@@ -225,9 +229,11 @@
(call-with-values
(lambda ()
- (http-get uri
- #:decode-body? #f
- #:streaming? #t))
+ (retry-on-error
+ (lambda ()
+ (http-get uri
+ #:decode-body? #f
+ #:streaming? #t))))
(lambda (response body)
(unless (= (response-code response)
200)