]> git.elephly.net Git - software/mumi.git/commitdiff
scripts: Catch any errors in worker and restart.
authorRicardo Wurmus <rekado@elephly.net>
Mon, 30 Mar 2020 17:32:17 +0000 (19:32 +0200)
committerRicardo Wurmus <rekado@elephly.net>
Mon, 30 Mar 2020 17:32:17 +0000 (19:32 +0200)
scripts/mumi.in

index 34602928f34c206a022e5fc568b2429ef3200cc8..e0a4d1aa3ca05bd63d5e97e6b20d4f7ec9c28cdc 100644 (file)
@@ -27,6 +27,7 @@
              (system repl server)
              (ice-9 match)
              (ice-9 threads)
+             (ice-9 format)
              (mumi config)
              (mumi bugs)
              (mumi messages)
 
 (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