From 366a65f99f5c5d05dd27fbc3aa5b69e9b97f8095 Mon Sep 17 00:00:00 2001 From: Webysther Sperandio Date: Wed, 23 Oct 2024 22:22:50 +0200 Subject: [PATCH] Increase sqlite calibre cache --- cps/db.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cps/db.py b/cps/db.py index 557fdc75..a3e98541 100644 --- a/cps/db.py +++ b/cps/db.py @@ -621,6 +621,7 @@ class CalibreDB: connect_args={'check_same_thread': False}, poolclass=StaticPool) with check_engine.begin() as connection: + connection.execute(text('PRAGMA cache_size = 10000;')) connection.execute(text("attach database '{}' as calibre;".format(dbpath))) connection.execute(text("attach database '{}' as app_settings;".format(app_db_path))) local_session = scoped_session(sessionmaker()) @@ -658,6 +659,7 @@ class CalibreDB: connect_args={'check_same_thread': False}, poolclass=StaticPool) with cls.engine.begin() as connection: + connection.execute(text('PRAGMA cache_size = 10000;')) connection.execute(text("attach database '{}' as calibre;".format(dbpath))) connection.execute(text("attach database '{}' as app_settings;".format(app_db_path)))