From ef82c5c691b05a066c9b5f3b3618d402426a2b06 Mon Sep 17 00:00:00 2001 From: Blake Blackshear Date: Fri, 15 Oct 2021 07:30:55 -0500 Subject: [PATCH] fix expiration when event spans the exire date --- frigate/record.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/frigate/record.py b/frigate/record.py index dbd07fee4..c1f437641 100644 --- a/frigate/record.py +++ b/frigate/record.py @@ -203,7 +203,11 @@ class RecordingCleanup(threading.Thread): events: Event = ( Event.select() .where( - Event.camera == camera, Event.end_time < expire_date, Event.has_clip + Event.camera == camera, + # need to ensure segments for all events starting + # before the expire date are included + Event.start_time < expire_date, + Event.has_clip, ) .order_by(Event.start_time) .objects()