From da8579040d8f356e968350120859747022423a04 Mon Sep 17 00:00:00 2001 From: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com> Date: Fri, 17 Apr 2026 16:51:19 -0500 Subject: [PATCH] drop cache segments past retain cutoff regardless of retention mode --- frigate/record/maintainer.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/frigate/record/maintainer.py b/frigate/record/maintainer.py index 73868ea24..6d25622f4 100644 --- a/frigate/record/maintainer.py +++ b/frigate/record/maintainer.py @@ -464,10 +464,12 @@ class RecordingMaintainer(threading.Thread): self.drop_segment(cache_path) return None - # if it doesn't overlap with an review item, go ahead and drop the segment - # if it ends more than the configured pre_capture for the camera - # BUT only if continuous/motion is NOT enabled (otherwise wait for processing) - elif highest is None: + # if it doesn't overlap with a review item, drop the segment once it + # ends more than event_pre_capture before the most recently processed + # frame. at this point we've already decided not to keep it for + # continuous/motion retention (either disabled or segment_stats said + # discard), so waiting longer just fills the cache. + else: camera_info = self.object_recordings_info[camera] most_recently_processed_frame_time = ( camera_info[-1][0] if len(camera_info) > 0 else 0