Refactor how Redis locks are created (#18400)
* Refactor how Redis locks are created * Fix autorelease duration on account deletion lock
This commit is contained in:
parent
12535568f7
commit
6cf57c6765
16 changed files with 112 additions and 179 deletions
|
@ -1,11 +1,11 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Redisable
|
||||
extend ActiveSupport::Concern
|
||||
|
||||
private
|
||||
|
||||
def redis
|
||||
Thread.current[:redis] ||= RedisConfiguration.pool.checkout
|
||||
end
|
||||
|
||||
def with_redis(&block)
|
||||
RedisConfiguration.with(&block)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue