Formatting

This commit is contained in:
Nick Mowen 2023-06-06 07:53:42 -06:00
parent 1d8c9df1fc
commit 007d65cf0e
4 changed files with 7 additions and 5 deletions

View File

@ -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)

View File

@ -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

View File

@ -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)

View File

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