diff options
author | Christopher Baines <mail@cbaines.net> | 2022-05-05 13:24:00 +0100 |
---|---|---|
committer | Christopher Baines <mail@cbaines.net> | 2022-05-05 13:36:11 +0100 |
commit | c369d7292e82f85e6eb6157331267fa424703900 (patch) | |
tree | 0ceb7c23c31578ab71dc1905296919d014a03596 /nar-herder/storage.scm | |
parent | 89f1a2329c583e4da08ddf104fedc69e72a33d32 (diff) | |
download | nar-herder-c369d7292e82f85e6eb6157331267fa424703900.tar nar-herder-c369d7292e82f85e6eb6157331267fa424703900.tar.gz |
Skip mirroring files if downloading them fails
Until the next pass.
Diffstat (limited to 'nar-herder/storage.scm')
-rw-r--r-- | nar-herder/storage.scm | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/nar-herder/storage.scm b/nar-herder/storage.scm index c18be11..fab8966 100644 --- a/nar-herder/storage.scm +++ b/nar-herder/storage.scm @@ -336,13 +336,24 @@ (if (or no-storage-limit? (< (+ storage-size file-bytes) storage-limit)) - (begin - (retry-on-error - (lambda () - (fetch-file (assq-ref file 'url))) - #:times 3 - #:delay 5) - (loop (+ storage-size file-bytes) + (let ((success? + (with-exception-handler + (lambda (exn) + (log-msg 'ERROR "failed to fetch " + (assq-ref file 'url) + ": " exn) + #f) + (lambda () + (retry-on-error + (lambda () + (fetch-file (assq-ref file 'url))) + #:times 3 + #:delay 5) + #t) + #:unwind? #t))) + (loop (if success? + (+ storage-size file-bytes) + storage-size) (cdr missing-nar-files))) ;; This file won't fit, so try the next one (loop storage-size |