Skip to content

Commit

Permalink
Reduce recording info timeout (blakeblackshear#8506)
Browse files Browse the repository at this point in the history
* Decrease timeout

* Use const for queue timeout
  • Loading branch information
NickM-27 committed Nov 7, 2023
1 parent 1d99bb9 commit 257bd89
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions frigate/record/maintainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@

logger = logging.getLogger(__name__)

QUEUE_READ_TIMEOUT = 0.00001 # seconds


class SegmentInfo:
def __init__(
Expand Down Expand Up @@ -452,7 +454,9 @@ def run(self) -> None:
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
Expand Down Expand Up @@ -488,7 +492,9 @@ def run(self) -> None:
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
Expand Down

0 comments on commit 257bd89

Please sign in to comment.