From 469259d6632b5cef894f65120ead8ecbff970a05 Mon Sep 17 00:00:00 2001 From: Blake Blackshear Date: Sat, 8 Aug 2020 07:39:57 -0500 Subject: [PATCH] dont refresh cache if exiting --- frigate/events.py | 5 +++-- frigate/object_processing.py | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/frigate/events.py b/frigate/events.py index 708ae3e45..56d8e0388 100644 --- a/frigate/events.py +++ b/frigate/events.py @@ -137,11 +137,12 @@ class EventProcessor(threading.Thread): if self.stop_event.is_set(): print(f"Exiting event processor...") break - + try: event_type, camera, event_data = self.event_queue.get(timeout=10) except queue.Empty: - self.refresh_cache() + if not self.stop_event.is_set(): + self.refresh_cache() continue self.refresh_cache() diff --git a/frigate/object_processing.py b/frigate/object_processing.py index 5f67fc291..3bb2cf254 100644 --- a/frigate/object_processing.py +++ b/frigate/object_processing.py @@ -105,7 +105,7 @@ class TrackedObjectProcessor(threading.Thread): def run(self): while True: if self.stop_event.is_set(): - print(f"Exiting event processor...") + print(f"Exiting object processor...") break try: