From 7c2ad31a2159d44017ab7b3d7b1307087139619c Mon Sep 17 00:00:00 2001 From: croneter Date: Fri, 23 Jul 2021 10:49:10 +0200 Subject: [PATCH] Fix likelyhood of `database is locked` error occuring --- resources/lib/db.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/resources/lib/db.py b/resources/lib/db.py index e9faa8c9..4b0b9480 100644 --- a/resources/lib/db.py +++ b/resources/lib/db.py @@ -6,6 +6,7 @@ from functools import wraps from . import variables as v, app DB_WRITE_ATTEMPTS = 100 +DB_WRITE_ATTEMPTS_TIMEOUT = 1 # in seconds DB_CONNECTION_TIMEOUT = 10 @@ -43,7 +44,7 @@ def catch_operationalerrors(method): self.kodiconn.commit() if self.artconn: self.artconn.commit() - if app.APP.monitor.waitForAbort(0.1): + if app.APP.monitor.waitForAbort(DB_WRITE_ATTEMPTS_TIMEOUT): # PKC needs to quit return # Start new transactions