set the detection events on exit and return early from processing

This commit is contained in:
Blake Blackshear 2023-02-03 18:33:37 -06:00
parent 426a666210
commit 600c45246b
2 changed files with 11 additions and 0 deletions

View File

@ -416,6 +416,11 @@ class FrigateApp:
logger.info(f"Stopping...")
self.stop_event.set()
# Set the events for the camera processor processes because
# they may be waiting on the event coming out of the detection process
for name in self.config.cameras.keys():
self.detection_out_events[name].set()
self.dispatcher.stop()
self.detected_frames_processor.join()
self.event_processor.join()

View File

@ -723,6 +723,9 @@ def process_frames(
object_filters,
)
)
# if frigate is exiting
if stop_event.is_set():
return
#########
# merge objects, check for clipped objects and look again up to 4 times
@ -787,6 +790,9 @@ def process_frames(
refining = True
else:
selected_objects.append(obj)
# if frigate is exiting
if stop_event.is_set():
return
# set the detections list to only include top, complete objects
# and new detections
detections = selected_objects