浏览代码

if recording not on disk, delete from db and return

Blake Blackshear 3 年之前
父节点
当前提交
675f21e23a
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      frigate/record.py

+ 2 - 1
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(