mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-07-02 07:10:27 +00:00
A record-enabled camera whose record stream produces no cache segments never appears in grouped_recordings, so the per-camera prune in RecordingMaintainer.move_files() never runs for it. Its object_recordings_info and audio_recordings_info buffers then grow without bound until the recording process is OOM-killed (discussion #23451). Run a prune every move_files() cycle for cameras absent from grouped_recordings, dropping entries older than the longest a segment could still wait in cache before being matched (MAX_SEGMENTS_IN_CACHE * MAX_SEGMENT_DURATION * 2). Cameras present in grouped_recordings are left untouched and keep their existing prune. Add a regression test asserting that an absent camera's stale entries are dropped (recent ones kept) while a present camera's entries are left intact. Co-authored-by: John Pescatore <johnpescatore@claude.internal.johnpescatore.com>