From 14267d15db000f282932b2efd7adc205bcabda28 Mon Sep 17 00:00:00 2001 From: niten Date: Wed, 7 Jun 2023 13:30:13 -0700 Subject: [PATCH] Cannot 'recur' within 'try' --- src/suanni/client.clj | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/src/suanni/client.clj b/src/suanni/client.clj index 74356fa..7a2419d 100644 --- a/src/suanni/client.clj +++ b/src/suanni/client.clj @@ -130,18 +130,19 @@ (when verbose (println "stopping object listener") (async/close! mqtt-chan)) - (try - (do (>! mqtt-chan - {:type :detection-event - :time (Instant/now) - :detection - (select-keys detection-event - [:location - :camera-id - :detect-time - :objects - :detection-url])}) - (recur (! mqtt-chan + {:type :detection-event + :time (Instant/now) + :detection + (select-keys detection-event + [:location + :camera-id + :detect-time + :objects + :detection-url])}) + (catch Exception e + (println (.toString e)))) + (recur (SuanNiServer event-chan image-chan obj-chan listener)))