Reduce recording info timeout (#8506)

* Decrease timeout

* Use const for queue timeout
This commit is contained in:
Nicolas Mowen 2023-11-07 04:32:11 -07:00 committed by GitHub
parent 1d99bb908d
commit 257bd89733
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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