Only rollback for database locked

raise error for everything else, we should put in place a file that will
keep itemids we had to rollback on. To review later.
This commit is contained in:
angelblue05 2016-11-04 06:45:39 -05:00
parent ee80e2c763
commit e9fb760fa3
1 changed files with 3 additions and 2 deletions

View File

@ -88,8 +88,9 @@ class DatabaseConn(object):
if exc_type is not None: if exc_type is not None:
# Errors were raised in the with statement # Errors were raised in the with statement
log.error("rollback: Type: %s Value: %s", exc_type, exc_val) log.error("rollback: Type: %s Value: %s", exc_type, exc_val)
if "database is locked" in exc_val:
self.conn.rollback() self.conn.rollback()
if not "database is locked" in exc_val: else:
raise raise
elif self.commit_mode is not None and changes: elif self.commit_mode is not None and changes: