Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
cloud-infrastructure
data-analytics
Commits
21b62285
Commit
21b62285
authored
Apr 27, 2021
by
Antonin Dvorak
Committed by
Domenico Giordano
Apr 28, 2021
Browse files
sqlite3 - else instead of finally in retry wrapper
parent
5c7cfb2e
Changes
1
Hide whitespace changes
Inline
Side-by-side
adcern/sqlite3_backend.py
View file @
21b62285
...
...
@@ -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 sql
it
e
unsuccessful, retrying...."
)
print
(
"
Sqlite3 comm
it unsuccessful, retrying...."
)
time
.
sleep
(
1
)
pass
finally
:
else
:
print
(
"Sqlite3 commit succesfull, breaking the retry cycle."
)
break
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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