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
This commit is contained in:
Deviant 2022-07-07 17:11:47 +01:00
parent b36b63599b
commit 73f2c827c6

View File

@ -102,6 +102,7 @@ class RecordingMaintainer(threading.Thread):
if len(grouped_recordings[camera]) > keep_count: if len(grouped_recordings[camera]) > keep_count:
to_remove = grouped_recordings[camera][:-keep_count] to_remove = grouped_recordings[camera][:-keep_count]
for f in to_remove: for f in to_remove:
logger.warning(f"Discarding a recording segment: {f}")
Path(f["cache_path"]).unlink(missing_ok=True) Path(f["cache_path"]).unlink(missing_ok=True)
self.end_time_cache.pop(f["cache_path"], None) self.end_time_cache.pop(f["cache_path"], None)
grouped_recordings[camera] = grouped_recordings[camera][-keep_count:] grouped_recordings[camera] = grouped_recordings[camera][-keep_count:]