Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bb98894 commit a94dcf9Copy full SHA for a94dcf9
1 file changed
lib/utils/api.py
@@ -77,10 +77,17 @@ def commit(self):
77
self.connection.commit()
78
79
def execute(self, statement, arguments=None):
80
- if arguments:
81
- self.cursor.execute(statement, arguments)
82
- else:
83
- self.cursor.execute(statement)
+ while True:
+ try:
+ if arguments:
+ self.cursor.execute(statement, arguments)
84
+ else:
85
+ self.cursor.execute(statement)
86
+ except sqlite3.OperationalError, ex:
87
+ if not "locked" in ex.message:
88
+ raise
89
90
+ break
91
92
if statement.lstrip().upper().startswith("SELECT"):
93
return self.cursor.fetchall()
0 commit comments