mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-05 10:45:21 +03:00
Formatting
This commit is contained in:
parent
1d8c9df1fc
commit
007d65cf0e
@ -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)
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -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")'
|
||||
)
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user