Fast restart (#5378)

* dont wait so long for queues

* implement stop methods for comms

* set the detection events on exit and return early from processing

* handle the stop event in the broadcast threads

* short circuit the detection process exit code if it already exited

* some logging for stats thread

* just keep the log process alive 1 second after the last log message

* ensure the multiprocessing queues are emptied and closed

* Update frigate/log.py

Co-authored-by: Nicolas Mowen <nickmowen213@gmail.com>

* Update frigate/log.py

Co-authored-by: Nicolas Mowen <nickmowen213@gmail.com>

* mypy fixes

---------

Co-authored-by: Nicolas Mowen <nickmowen213@gmail.com>
This commit is contained in:
Blake Blackshear
2023-02-03 20:15:47 -06:00
committed by GitHub
parent b33094207c
commit 624c314335
11 changed files with 76 additions and 15 deletions

View File

@@ -601,7 +601,7 @@ def process_frames(
break
try:
frame_time = frame_queue.get(True, 10)
frame_time = frame_queue.get(True, 1)
except queue.Empty:
continue
@@ -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