diff options
author | Christopher Baines <mail@cbaines.net> | 2022-05-05 12:12:00 +0100 |
---|---|---|
committer | Christopher Baines <mail@cbaines.net> | 2022-05-05 12:12:00 +0100 |
commit | 89f1a2329c583e4da08ddf104fedc69e72a33d32 (patch) | |
tree | 966a017a22957fcbe41cc8845fb1bf0b7d8a7f8a /nar-herder/storage.scm | |
parent | 7c582f187aff9ba9f491b8a2961211a6cc3d6f78 (diff) | |
download | nar-herder-89f1a2329c583e4da08ddf104fedc69e72a33d32.tar nar-herder-89f1a2329c583e4da08ddf104fedc69e72a33d32.tar.gz |
Handle exceptions in threads
Diffstat (limited to 'nar-herder/storage.scm')
-rw-r--r-- | nar-herder/storage.scm | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/nar-herder/storage.scm b/nar-herder/storage.scm index 090e974..c18be11 100644 --- a/nar-herder/storage.scm +++ b/nar-herder/storage.scm @@ -252,7 +252,11 @@ (call-with-new-thread (lambda () (while #t - (run-removal-pass) + (with-exception-handler + (lambda (exn) + (log-msg 'ERROR "nar removal pass failed " exn)) + run-removal-pass + #:unwind? #t) (sleep 300))))) @@ -342,12 +346,16 @@ (cdr missing-nar-files))) ;; This file won't fit, so try the next one (loop storage-size - (cdr missing-nar-files)))))))))) + (cdr missing-nar-files))))))))) + (log-msg 'DEBUG "finished mirror pass")) (call-with-new-thread (lambda () (while #t - (run-mirror-pass) - (log-msg 'DEBUG "finished mirror pass") + (with-exception-handler + (lambda (exn) + (log-msg 'ERROR "mirror pass failed " exn)) + run-mirror-pass + #:unwind? #t) (sleep 300))))) |