Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
cloud-infrastructure
data-analytics
Commits
52c78b22
Commit
52c78b22
authored
May 01, 2021
by
Domenico Giordano
Browse files
fix issue on sqlite3 with statement
parent
81b3a5d7
Changes
1
Hide whitespace changes
Inline
Side-by-side
adcern/sqlite3_backend.py
View file @
52c78b22
...
...
@@ -18,20 +18,20 @@ def modify_db(conn,
additional arguments for execute query, optional
"""
with
conn
.
cursor
()
as
c
:
for
x
in
range
(
1
,
11
):
try
:
if
args
:
c
.
execute
(
query
,
args
)
else
:
c
.
execute
(
query
)
except
:
print
(
"Sqlite3 execute unsuccessful, retrying after %s sec...."
%
x
)
time
.
sleep
(
x
)
pass
c
=
conn
.
cursor
()
for
x
in
range
(
1
,
11
):
try
:
if
args
:
c
.
execute
(
query
,
args
)
else
:
print
(
"Sqlite3 execute successful, breaking the retry cycle."
)
break
c
.
execute
(
query
)
except
:
print
(
"Sqlite3 execute unsuccessful, retrying after %s sec...."
%
x
)
time
.
sleep
(
x
)
pass
else
:
print
(
"Sqlite3 execute successful, breaking the retry cycle."
)
break
# retry commit - db might be locked by different process
for
x
in
range
(
1
,
11
):
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment