Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
backend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Package registry
Container registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
videoag
backend
Commits
b4eb2bf8
Commit
b4eb2bf8
authored
1 month ago
by
Simon Künzel
Browse files
Options
Downloads
Patches
Plain Diff
Log exception on database commit conflict
parent
b4a3cdc0
Branches
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#7607
passed
1 month ago
Stage: build
Stage: run
Pipeline: backend
#7608
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
common_py/src/videoag_common/database/database.py
+1
-1
1 addition, 1 deletion
common_py/src/videoag_common/database/database.py
with
1 addition
and
1 deletion
common_py/src/videoag_common/database/database.py
+
1
−
1
View file @
b4eb2bf8
...
@@ -224,7 +224,7 @@ class Database:
...
@@ -224,7 +224,7 @@ class Database:
# Sleep a random time for up to 500ms to increase chance that next attempt succeeds (The randomness makes
# Sleep a random time for up to 500ms to increase chance that next attempt succeeds (The randomness makes
# it more likely that we reattempt at a different time than the one with which we are in conflict right now)
# it more likely that we reattempt at a different time than the one with which we are in conflict right now)
time
.
sleep
(
random
.
random
()
/
2
)
time
.
sleep
(
random
.
random
()
/
2
)
print
(
"
Warning: Reattempting transaction after commit conflict
"
)
print
(
"
Warning: Reattempting transaction after commit conflict
"
,
e
)
continue
continue
raise
AssertionError
(
"
This should be unreachable code
"
)
raise
AssertionError
(
"
This should be unreachable code
"
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment