From 007d65cf0e9ec910629895fac6e179d4301d39a1 Mon Sep 17 00:00:00 2001 From: Nick Mowen Date: Tue, 6 Jun 2023 07:53:42 -0600 Subject: [PATCH] Formatting --- frigate/app.py | 4 ++-- frigate/record/cleanup.py | 4 +++- frigate/record/record.py | 2 +- migrations/017_update_indexes.py | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/frigate/app.py b/frigate/app.py index 79147d221..0ad72630d 100644 --- a/frigate/app.py +++ b/frigate/app.py @@ -206,8 +206,8 @@ class FrigateApp: """Bind db to the main process.""" # NOTE: all db accessing processes need to be created before the db can be bound to the main process self.db = SqliteQueueDatabase( - self.config.database.path, - pragmas={'auto_vacuum': 'FULL'}, # Does not defragment database + self.config.database.path, + pragmas={"auto_vacuum": "FULL"}, # Does not defragment database ) models = [Event, Recordings, Timeline] self.db.bind(models) diff --git a/frigate/record/cleanup.py b/frigate/record/cleanup.py index c87eecacd..f2e9a4fb5 100644 --- a/frigate/record/cleanup.py +++ b/frigate/record/cleanup.py @@ -180,7 +180,9 @@ class RecordingCleanup(threading.Thread): # find all the recordings older than the oldest recording in the db try: - oldest_recording = Recordings.select().order_by(Recordings.start_time).limit(1).get() + oldest_recording = ( + Recordings.select().order_by(Recordings.start_time).limit(1).get() + ) p = Path(oldest_recording.path) oldest_timestamp = p.stat().st_mtime - 1 diff --git a/frigate/record/record.py b/frigate/record/record.py index 8916934d8..deac65f1a 100644 --- a/frigate/record/record.py +++ b/frigate/record/record.py @@ -39,7 +39,7 @@ def manage_recordings( db = SqliteQueueDatabase( config.database.path, - pragmas={'auto_vacuum': 'FULL'}, # Does not defragment database + pragmas={"auto_vacuum": "FULL"}, # Does not defragment database ) models = [Event, Recordings, Timeline] db.bind(models) diff --git a/migrations/017_update_indexes.py b/migrations/017_update_indexes.py index a08488fd9..8aa53f8ee 100644 --- a/migrations/017_update_indexes.py +++ b/migrations/017_update_indexes.py @@ -27,7 +27,7 @@ SQL = pw.SQL def migrate(migrator, database, fake=False, **kwargs): migrator.sql( - 'CREATE INDEX "recordings_segment_size" ON "recordings" ("camera", "segment_size")' + 'CREATE INDEX "recordings_camera_segment_size" ON "recordings" ("camera", "segment_size")' )