Fix single Redis connection being used across all threads (#18135)
* Fix single Redis connection being used across all Sidekiq threads * Fix tests
This commit is contained in:
parent
9bf04db23a
commit
3917353645
44 changed files with 243 additions and 124 deletions
|
@ -3,6 +3,7 @@
|
|||
class VoteService < BaseService
|
||||
include Authorization
|
||||
include Payloadable
|
||||
include Redisable
|
||||
|
||||
def call(account, poll, choices)
|
||||
authorize_with account, poll, :vote?
|
||||
|
@ -77,6 +78,6 @@ class VoteService < BaseService
|
|||
end
|
||||
|
||||
def lock_options
|
||||
{ redis: Redis.current, key: "vote:#{@poll.id}:#{@account.id}" }
|
||||
{ redis: redis, key: "vote:#{@poll.id}:#{@account.id}" }
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue