mirror of
https://github.com/blakeblackshear/frigate.git
synced 2025-01-07 00:06:57 +01:00
make expiration of deleted camera footage faster
This commit is contained in:
parent
c793500ad2
commit
bc350644bd
@ -166,9 +166,13 @@ class RecordingCleanup(threading.Thread):
|
||||
Recordings.end_time < expire_before,
|
||||
)
|
||||
|
||||
deleted_recordings = set()
|
||||
for recording in no_camera_recordings:
|
||||
Path(recording.path).unlink(missing_ok=True)
|
||||
Recordings.delete_by_id(recording.id)
|
||||
deleted_recordings.add(recording.id)
|
||||
|
||||
logger.debug(f"Expiring {len(deleted_recordings)} recordings")
|
||||
Recordings.delete().where(Recordings.id << deleted_recordings).execute()
|
||||
logger.debug("End deleted cameras.")
|
||||
|
||||
logger.debug("Start all cameras.")
|
||||
|
Loading…
Reference in New Issue
Block a user