From 183b1e7126f67ad5cb9068c44324ca6f7b2abe04 Mon Sep 17 00:00:00 2001 From: Nick Mowen Date: Tue, 6 Jun 2023 08:08:22 -0600 Subject: [PATCH] Set DB mode to NORMAL synchronous level --- frigate/app.py | 3 ++- frigate/record/record.py | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/frigate/app.py b/frigate/app.py index fdd1d5242..845e5ce28 100644 --- a/frigate/app.py +++ b/frigate/app.py @@ -209,7 +209,8 @@ class FrigateApp: self.config.database.path, pragmas={ "auto_vacuum": "FULL", # Does not defragment database - "cache_size": -512 * 1000, # 512MB of cache + "cache_size": -512 * 1000, # 512MB of cache, + 'synchronous': 'NORMAL', # Safe when using WAL https://www.sqlite.org/pragma.html#pragma_synchronous }, timeout=60, ) diff --git a/frigate/record/record.py b/frigate/record/record.py index 3870a1b44..8ee8b798b 100644 --- a/frigate/record/record.py +++ b/frigate/record/record.py @@ -42,6 +42,7 @@ def manage_recordings( pragmas={ "auto_vacuum": "FULL", # Does not defragment database "cache_size": -512 * 1000, # 512MB of cache + 'synchronous': 'NORMAL', # Safe when using WAL https://www.sqlite.org/pragma.html#pragma_synchronous }, timeout=60, )