diff --git a/frigate/app.py b/frigate/app.py index 7a9f7538b..5abf954d8 100644 --- a/frigate/app.py +++ b/frigate/app.py @@ -313,7 +313,7 @@ class FrigateApp: "cache_size": -512 * 1000, # 512MB of cache, "synchronous": "NORMAL", # Safe when using WAL https://www.sqlite.org/pragma.html#pragma_synchronous }, - timeout=60, + timeout=10 * len([c for c in self.config.cameras.values() if c.enabled]), ) models = [Event, Recordings, Timeline] self.db.bind(models) diff --git a/frigate/record/record.py b/frigate/record/record.py index c76ff3d63..6e40ac01c 100644 --- a/frigate/record/record.py +++ b/frigate/record/record.py @@ -45,7 +45,7 @@ def manage_recordings( "cache_size": -512 * 1000, # 512MB of cache "synchronous": "NORMAL", # Safe when using WAL https://www.sqlite.org/pragma.html#pragma_synchronous }, - timeout=60, + timeout=10 * len([c for c in config.cameras.values() if c.enabled]), ) models = [Event, Recordings, Timeline, RecordingsToDelete] db.bind(models)