mirror of
https://github.com/moparisthebest/SickRage
synced 2025-01-06 03:18:01 -05:00
fix for recent sql errors around connection object
This commit is contained in:
parent
7e5cc8c673
commit
8fbd9155d3
@ -126,7 +126,6 @@ class DBConnection:
|
||||
|
||||
while attempt < 5:
|
||||
try:
|
||||
|
||||
with self.connection as trans:
|
||||
for qu in querylist:
|
||||
if len(qu) == 1:
|
||||
@ -142,8 +141,8 @@ class DBConnection:
|
||||
return sqlResult
|
||||
except sqlite3.OperationalError, e:
|
||||
sqlResult = []
|
||||
if trans.connection:
|
||||
trans.rollback()
|
||||
if self.connection:
|
||||
self.connection.rollback()
|
||||
if "unable to open database file" in e.args[0] or "database is locked" in e.args[0]:
|
||||
logger.log(u"DB error: " + ex(e), logger.WARNING)
|
||||
attempt += 1
|
||||
@ -152,8 +151,8 @@ class DBConnection:
|
||||
raise
|
||||
except sqlite3.DatabaseError, e:
|
||||
sqlResult = []
|
||||
if trans.connection:
|
||||
trans.rollback()
|
||||
if self.connection:
|
||||
self.connection.rollback()
|
||||
logger.log(u"Fatal error executing query: " + ex(e), logger.ERROR)
|
||||
raise
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user