Ensure that all processes are stopped

This commit is contained in:
Nicolas Mowen 2024-02-16 11:49:22 -07:00
parent cc5a95df97
commit 7090b808af
7 changed files with 14 additions and 0 deletions

View File

@ -685,6 +685,7 @@ class FrigateApp:
self.detection_queue.join_thread() self.detection_queue.join_thread()
self.dispatcher.stop() self.dispatcher.stop()
self.inter_config_updater.stop()
self.detected_frames_processor.join() self.detected_frames_processor.join()
self.ptz_autotracker_thread.join() self.ptz_autotracker_thread.join()
self.event_processor.join() self.event_processor.join()

View File

@ -351,3 +351,4 @@ class AudioEventMaintainer(threading.Thread):
stop_ffmpeg(self.audio_listener, self.logger) stop_ffmpeg(self.audio_listener, self.logger)
self.logpipe.close() self.logpipe.close()
self.requestor.stop() self.requestor.stop()
self.config_subscriber.stop()

View File

@ -24,3 +24,7 @@ class MotionDetector(ABC):
@abstractmethod @abstractmethod
def is_calibrating(self): def is_calibrating(self):
pass pass
@abstractmethod
def stop(self):
pass

View File

@ -201,3 +201,7 @@ class ImprovedMotionDetector(MotionDetector):
self.motion_frame_count = 0 self.motion_frame_count = 0
return motion_boxes return motion_boxes
def stop(self) -> None:
"""stop the motion detector."""
self.config_subscriber.stop()

View File

@ -785,5 +785,6 @@ class Birdseye:
pass pass
def stop(self) -> None: def stop(self) -> None:
self.config_subscriber.stop()
self.converter.join() self.converter.join()
self.broadcaster.join() self.broadcaster.join()

View File

@ -543,4 +543,5 @@ class RecordingMaintainer(threading.Thread):
wait_time = max(0, 5 - duration) wait_time = max(0, 5 - duration)
self.requestor.stop() self.requestor.stop()
self.config_subscriber.stop()
logger.info("Exiting recording maintenance...") logger.info("Exiting recording maintenance...")

View File

@ -817,4 +817,6 @@ def process_frames(
detection_fps.value = object_detector.fps.eps() detection_fps.value = object_detector.fps.eps()
frame_manager.close(f"{camera_name}{frame_time}") frame_manager.close(f"{camera_name}{frame_time}")
motion_detector.stop()
requestor.stop() requestor.stop()
config_subscriber.stop()