From 73f2c827c6273ab7aa0cf5b31180be8532c7778f Mon Sep 17 00:00:00 2001 From: Deviant <16081842+deviant77@users.noreply.github.com> Date: Thu, 7 Jul 2022 17:11:47 +0100 Subject: [PATCH] Add log message when discarding recording segments in cache Currently Frigate silently discards recording segments in cache if there's more than "keep_count" for a camera, which can happen on high load/busy/slow systems. This results in recording segments being lost with no apparent cause in the logs (even when set to debug). This PR adds a warning log entry when discarding segments, in the same way as discarding corrupted segments --- frigate/record.py | 1 + 1 file changed, 1 insertion(+) diff --git a/frigate/record.py b/frigate/record.py index bdc3d5671..62e45d48e 100644 --- a/frigate/record.py +++ b/frigate/record.py @@ -102,6 +102,7 @@ class RecordingMaintainer(threading.Thread): if len(grouped_recordings[camera]) > keep_count: to_remove = grouped_recordings[camera][:-keep_count] for f in to_remove: + logger.warning(f"Discarding a recording segment: {f}") Path(f["cache_path"]).unlink(missing_ok=True) self.end_time_cache.pop(f["cache_path"], None) grouped_recordings[camera] = grouped_recordings[camera][-keep_count:]