From 07ad2d97b12b7bad1fa2501204b47e107e9f0e41 Mon Sep 17 00:00:00 2001 From: Blake Blackshear Date: Sun, 21 Nov 2021 07:26:31 -0600 Subject: [PATCH] handle missing file edge case --- frigate/record.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/frigate/record.py b/frigate/record.py index 56bc37b7e..b4561eb08 100644 --- a/frigate/record.py +++ b/frigate/record.py @@ -405,8 +405,11 @@ class RecordingCleanup(threading.Thread): for f in files_to_check: p = Path(f) - if p.stat().st_mtime < delete_before.get(p.parent.name, default_expire): - p.unlink(missing_ok=True) + try: + if p.stat().st_mtime < delete_before.get(p.parent.name, default_expire): + p.unlink(missing_ok=True) + except FileNotFoundError: + logger.warning(f"Attempted to expire missing file: {f}") logger.debug("End expire files (legacy).")