From 132274579cf0f5b81d10eb8b87afbcf43e555de3 Mon Sep 17 00:00:00 2001 From: Nick Mowen Date: Mon, 26 Sep 2022 14:21:14 -0600 Subject: [PATCH] Don't run for a camera with no recording segments --- frigate/storage.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/frigate/storage.py b/frigate/storage.py index 38178e6bf..9bd2658cf 100644 --- a/frigate/storage.py +++ b/frigate/storage.py @@ -84,7 +84,6 @@ class StorageMaintainer(threading.Thread): ) -> set[str]: """Delete Recording Segments""" # loop over recordings and see if they overlap with any retained events - # TODO: expire segments based on segment stats according to config event_start = 0 deleted_recordings = set() for recording in recordings.objects().iterator(): @@ -140,6 +139,9 @@ class StorageMaintainer(threading.Thread): .limit(segment_count * 12) ) + if len(recordings) == 0: + continue + # cameras that are only recording part time # should not be forced to have 2 hours of # recordings disabled