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")' )