aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--nar-herder/storage.scm31
1 files changed, 15 insertions, 16 deletions
diff --git a/nar-herder/storage.scm b/nar-herder/storage.scm
index 57f35fb..87e2ff1 100644
--- a/nar-herder/storage.scm
+++ b/nar-herder/storage.scm
@@ -424,22 +424,21 @@ When VERIFY-CERTIFICATE? is true, verify HTTPS server certificates."
(lambda ()
(retry-on-error
(lambda ()
- (call-with-values
- (lambda ()
- (call-with-cached-connection
- uri
- (lambda (port)
- (http-get uri
- #:port port
- #:decode-body? #f
- #:keep-alive? #t
- #:streaming? #t))))
- (lambda (response body)
- (and (= (response-code response)
- 200)
- (let ((json-body (json->scm body)))
- (eq? (assoc-ref json-body "stored")
- #t))))))
+ (call-with-cached-connection
+ uri
+ (lambda (port)
+ (let ((response
+ body
+ (http-get uri
+ #:port port
+ #:decode-body? #f
+ #:keep-alive? #t
+ #:streaming? #t)))
+ (and (= (response-code response)
+ 200)
+ (let ((json-body (json->scm body)))
+ (eq? (assoc-ref json-body "stored")
+ #t)))))))
#:times 3
#:delay 5))
#:timeout 30)))))