From 8bffc5a30fcfd5b6daf62f31dcdaef0b1d23599a Mon Sep 17 00:00:00 2001 From: croneter Date: Sat, 3 Nov 2018 18:40:11 +0100 Subject: [PATCH] Fix OperationalError: Database is locked and heavily speed up sync --- resources/lib/utils.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/resources/lib/utils.py b/resources/lib/utils.py index 3e3014fa..80a1fb0a 100644 --- a/resources/lib/utils.py +++ b/resources/lib/utils.py @@ -474,7 +474,9 @@ def kodi_sql(media_type=None): db_path = v.DB_TEXTURE_PATH else: db_path = v.DB_VIDEO_PATH - return connect(db_path, timeout=60.0) + conn = connect(db_path, timeout=5.0) + conn.execute('PRAGMA journal_mode=WAL') + return conn def create_actor_db_index():