aboutsummaryrefslogtreecommitdiff
path: root/nar-herder/server.scm
diff options
context:
space:
mode:
Diffstat (limited to 'nar-herder/server.scm')
-rw-r--r--nar-herder/server.scm46
1 files changed, 26 insertions, 20 deletions
diff --git a/nar-herder/server.scm b/nar-herder/server.scm
index 2b941b9..fecf166 100644
--- a/nar-herder/server.scm
+++ b/nar-herder/server.scm
@@ -810,26 +810,32 @@
(spawn-fiber
(lambda ()
(while #t
- (match (get-message addition-channel)
- (('addition file)
- (when mirror-channel
- (put-message mirror-channel
- `(fetch ,file)))
- (when removal-channel
- (spawn-fiber
- (lambda ()
- (sleep 60)
- (removal-channel-remove-nar-from-storage removal-channel
- file)
- (sleep (* 5 60))
- (removal-channel-remove-nar-from-storage removal-channel
- file)
- (sleep (* 15 60))
- (removal-channel-remove-nar-from-storage removal-channel
- file)
- (sleep 3600)
- (removal-channel-remove-nar-from-storage removal-channel
- file)))))))))
+ (with-exception-handler
+ (lambda (exn)
+ (log-msg 'ERROR "exception processing addition-channel: "
+ exn))
+ (lambda ()
+ (match (get-message addition-channel)
+ (('addition file)
+ (when mirror-channel
+ (put-message mirror-channel
+ `(fetch ,file)))
+ (when removal-channel
+ (spawn-fiber
+ (lambda ()
+ (sleep 60)
+ (removal-channel-remove-nar-from-storage removal-channel
+ file)
+ (sleep (* 5 60))
+ (removal-channel-remove-nar-from-storage removal-channel
+ file)
+ (sleep (* 15 60))
+ (removal-channel-remove-nar-from-storage removal-channel
+ file)
+ (sleep 3600)
+ (removal-channel-remove-nar-from-storage removal-channel
+ file)))))))
+ #:unwind? #t))))
(start-recent-change-listener-fiber
database