Merge pull request #1545 from croneter/py3-locked-database

Fix likelyhood of `database is locked` error occuring
This commit is contained in:
croneter 2021-07-23 11:04:16 +02:00 committed by GitHub
commit 38e4f6e20f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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