Add optimistic lock to avoid race conditions when handling votes (#10196)
* Add optimistic lock to avoid race conditions when handling votes * Force-reload polls when getting `ActiveRecord::StaleObjectError`
This commit is contained in:
parent
b3668a79ec
commit
96f905f409
4 changed files with 12 additions and 1 deletions
|
@ -15,6 +15,7 @@
|
|||
# last_fetched_at :datetime
|
||||
# created_at :datetime not null
|
||||
# updated_at :datetime not null
|
||||
# lock_version :integer default(0), not null
|
||||
#
|
||||
|
||||
class Poll < ApplicationRecord
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue