From 257bd897331739c22fb03a18f17a8e8a06838791 Mon Sep 17 00:00:00 2001 From: Nicolas Mowen Date: Tue, 7 Nov 2023 04:32:11 -0700 Subject: [PATCH] Reduce recording info timeout (#8506) * Decrease timeout * Use const for queue timeout --- frigate/record/maintainer.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/frigate/record/maintainer.py b/frigate/record/maintainer.py index 8e9f900bb..ce1aa2e19 100644 --- a/frigate/record/maintainer.py +++ b/frigate/record/maintainer.py @@ -32,6 +32,8 @@ from frigate.util.services import get_video_properties logger = logging.getLogger(__name__) +QUEUE_READ_TIMEOUT = 0.00001 # seconds + class SegmentInfo: def __init__( @@ -452,7 +454,9 @@ class RecordingMaintainer(threading.Thread): current_tracked_objects, motion_boxes, regions, - ) = self.object_recordings_info_queue.get(True, timeout=0.01) + ) = self.object_recordings_info_queue.get( + True, timeout=QUEUE_READ_TIMEOUT + ) if frame_time < run_start - stale_frame_count_threshold: stale_frame_count += 1 @@ -488,7 +492,9 @@ class RecordingMaintainer(threading.Thread): frame_time, dBFS, audio_detections, - ) = self.audio_recordings_info_queue.get(True, timeout=0.01) + ) = self.audio_recordings_info_queue.get( + True, timeout=QUEUE_READ_TIMEOUT + ) if frame_time < run_start - stale_frame_count_threshold: stale_frame_count += 1