Force-Reboot Kodi immediately if sqlite PRAGMA WAL causes errors
This commit is contained in:
parent
22ea4a6a7c
commit
3f173f9677
1 changed files with 6 additions and 1 deletions
|
@ -403,7 +403,12 @@ 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 OperationalError:
|
||||||
|
LOG.warn('Issue with sqlite WAL mode - force-rebooting Kodi')
|
||||||
|
settings('lastfullsync', value='0')
|
||||||
|
reboot_kodi()
|
||||||
conn.execute('PRAGMA cache_size = -8000;')
|
conn.execute('PRAGMA cache_size = -8000;')
|
||||||
conn.execute('PRAGMA synchronous=NORMAL;')
|
conn.execute('PRAGMA synchronous=NORMAL;')
|
||||||
# Use transactions
|
# Use transactions
|
||||||
|
|
Loading…
Reference in a new issue