Skip to content

Commit

Permalink
make expiration of deleted camera footage faster
Browse files Browse the repository at this point in the history
  • Loading branch information
blakeblackshear committed Sep 17, 2021
1 parent c793500 commit bc35064
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion frigate/record.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,13 @@ def expire_recordings(self):
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.")
Expand Down

0 comments on commit bc35064

Please sign in to comment.