Commit 21b62285 authored by Antonin Dvorak's avatar Antonin Dvorak Committed by Domenico Giordano
Browse files

sqlite3 - else instead of finally in retry wrapper

parent 5c7cfb2e
......@@ -29,7 +29,8 @@ def modify_db(conn,
print("Sqlite3 execute unsuccessful, retrying....")
time.sleep(1)
pass
finally:
else:
print("Sqlite3 execute succesfull, breaking the retry cycle.")
break
# retry commit - db might be locked by different process
......@@ -37,8 +38,9 @@ def modify_db(conn,
try:
conn.commit()
except:
print("Commit to sqlite unsuccessful, retrying....")
print("Sqlite3 commit unsuccessful, retrying....")
time.sleep(1)
pass
finally:
else:
print("Sqlite3 commit succesfull, breaking the retry cycle.")
break
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment