Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
this works with SQLServer and appears to be generally less database s…
…pecific and fragile
- Loading branch information
1 parent
a0d9807
commit b015618
Showing
1 changed file
with
7 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
b015618
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this still contains a race condition - two workers can get to the with_lock at the same time with the same job, and they'll both update the same job & return it in sequence, so the job would get processed twice. Since
with_lock
reloads the job with the lock, I think this can be fixed by just putting this after thewith_lock
: