summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRicardo Wurmus <rekado@elephly.net>2020-03-30 19:32:17 +0200
committerRicardo Wurmus <rekado@elephly.net>2020-03-30 19:32:17 +0200
commitc4730af97cf60a6159ad73437b27426cd9bfada6 (patch)
tree9dcd940afe37fdd4a2055f9b67bd1785d5446506
parent5521df26f7baa484f542b5f47db8f826f1f57158 (diff)
scripts: Catch any errors in worker and restart.
-rw-r--r--scripts/mumi.in15
1 files changed, 11 insertions, 4 deletions
diff --git a/scripts/mumi.in b/scripts/mumi.in
index 3460292..e0a4d1a 100644
--- a/scripts/mumi.in
+++ b/scripts/mumi.in
@@ -27,6 +27,7 @@
(system repl server)
(ice-9 match)
(ice-9 threads)
+ (ice-9 format)
(mumi config)
(mumi bugs)
(mumi messages)
@@ -56,10 +57,16 @@
(define update-state!
(lambda _
- (mu-index)
- (update-bug-database!)
- (sleep %update-interval)
- (update-state!)))
+ (catch #t
+ (lambda ()
+ (mu-index)
+ (update-bug-database!)
+ (sleep %update-interval)
+ (update-state!))
+ (lambda args
+ (format (current-error-port) "worker error: ~a~%" args)
+ (sleep %update-interval)
+ (update-state!)))))
(define %options
;; Specifications of the command-line options