From f2ff55dba2c8548fedca3f4a4a3da7d7a5feaaf8 Mon Sep 17 00:00:00 2001 From: Nicolas Mowen Date: Wed, 19 Jul 2023 06:42:32 -0600 Subject: [PATCH] Set timeout based on number of cameras (#7219) --- frigate/app.py | 2 +- frigate/record/record.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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)