2019-02-03 05:11:38 +11:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Redisable
|
|
|
|
def redis
|
2024-09-03 00:19:55 +10:00
|
|
|
Thread.current[:redis] ||= RedisConnection.pool.checkout
|
2019-02-03 05:11:38 +11:00
|
|
|
end
|
2022-05-13 08:02:35 +10:00
|
|
|
|
|
|
|
def with_redis(&block)
|
2024-09-03 00:19:55 +10:00
|
|
|
RedisConnection.with(&block)
|
2022-05-13 08:02:35 +10:00
|
|
|
end
|
2019-02-03 05:11:38 +11:00
|
|
|
end
|