Enable auto vacuums

This commit is contained in:
Nicolas Mowen 2023-06-05 16:57:24 -06:00 committed by Nick Mowen
parent d3949eebfa
commit 5d8bcc0c38

View File

@ -205,7 +205,10 @@ class FrigateApp:
def bind_database(self) -> None:
"""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)
self.db = SqliteQueueDatabase(
self.config.database.path,
pragmas={'auto_vacuum', 'FULL'}, # Does not defragment database
)
models = [Event, Recordings, Timeline]
self.db.bind(models)