Catch error if Kodi DB cannot be used in WAL mode
This commit is contained in:
parent
9cc731e18f
commit
866412a720
1 changed files with 4 additions and 1 deletions
|
@ -403,7 +403,10 @@ def kodi_sql(media_type=None):
|
||||||
else:
|
else:
|
||||||
db_path = v.DB_VIDEO_PATH
|
db_path = v.DB_VIDEO_PATH
|
||||||
conn = connect(db_path, timeout=5.0)
|
conn = connect(db_path, timeout=5.0)
|
||||||
conn.execute('PRAGMA journal_mode=WAL;')
|
try:
|
||||||
|
conn.execute('PRAGMA journal_mode=WAL;')
|
||||||
|
except IOError:
|
||||||
|
LOG.warn('PKC could NOT activate sqlite WAL mode, sync might be slow')
|
||||||
conn.execute('PRAGMA synchronous=NORMAL;')
|
conn.execute('PRAGMA synchronous=NORMAL;')
|
||||||
# Use transactions
|
# Use transactions
|
||||||
conn.execute('BEGIN')
|
conn.execute('BEGIN')
|
||||||
|
|
Loading…
Reference in a new issue