mirror of
https://github.com/samsonjs/rack-attack.git
synced 2026-04-27 15:07:41 +00:00
Handle older Dalli clients
This commit is contained in:
parent
128c5aa9bf
commit
92be2791ab
1 changed files with 4 additions and 2 deletions
|
|
@ -14,9 +14,11 @@ module Rack
|
||||||
|
|
||||||
if defined?(::Redis::Store) && store.is_a?(::Redis::Store)
|
if defined?(::Redis::Store) && store.is_a?(::Redis::Store)
|
||||||
RedisStoreProxy.new(store)
|
RedisStoreProxy.new(store)
|
||||||
elsif store.respond_to?(:with)
|
elsif defined?(::Dalli) && store.is_a?(::Dalli::Client)
|
||||||
|
DalliProxy.new(store)
|
||||||
|
elsif defined?(::ConnectionPool) && store.is_a?(::ConnectionPool)
|
||||||
store.with do |conn|
|
store.with do |conn|
|
||||||
if defined?(::Dalli) && conn.is_a?(::Dalli::Client)
|
if conn.is_a?(::Dalli::Client)
|
||||||
DalliProxy.new(store)
|
DalliProxy.new(store)
|
||||||
else
|
else
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue