aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--nar-herder/storage.scm16
1 files changed, 6 insertions, 10 deletions
diff --git a/nar-herder/storage.scm b/nar-herder/storage.scm
index 5490226..e5ba57e 100644
--- a/nar-herder/storage.scm
+++ b/nar-herder/storage.scm
@@ -336,16 +336,12 @@ When VERIFY-CERTIFICATE? is true, verify HTTPS server certificates."
socket))))))))
(define (call-with-cached-connection uri proc)
- (with-exception-handler
- (lambda (exn)
- ;; Get a new connection, in case this exception is the result
- ;; of a connection issue
- (open-socket-for-uri/cached uri #:fresh? #t)
-
- (raise-exception exn))
- (lambda ()
- (proc (open-socket-for-uri/cached uri)))
- #:unwind? #t))
+ (let ((port (open-socket-for-uri/cached uri)))
+ (with-throw-handler #t
+ (lambda ()
+ (proc port))
+ (lambda _
+ (close-port port)))))
(define (start-nar-removal-fiber database
storage-root storage-limit