From 675f21e23a6308f93c4775e7fa4f35c620645589 Mon Sep 17 00:00:00 2001 From: Blake Blackshear Date: Wed, 2 Feb 2022 07:29:45 -0600 Subject: [PATCH] if recording not on disk, delete from db and return --- frigate/record.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frigate/record.py b/frigate/record.py index 3d6c0bd01..162d24aa8 100644 --- a/frigate/record.py +++ b/frigate/record.py @@ -497,7 +497,8 @@ class RecordingCleanup(threading.Thread): oldest_timestamp = datetime.datetime.now().timestamp() except FileNotFoundError: logger.warning(f"Unable to find file from recordings database: {p}") - oldest_timestamp = datetime.datetime.now().timestamp() + Recordings.delete().where(Recordings.id == oldest_recording.id).execute() + return logger.debug(f"Oldest recording in the db: {oldest_timestamp}") process = sp.run(