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:
Eugen Rochko
2022-05-13 00:02:35 +02:00
committed by GitHub
parent 12535568f7
commit 6cf57c6765
16 changed files with 112 additions and 179 deletions

View File

@@ -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