Handle older Dalli clients

This commit is contained in:
hakanensari 2014-04-01 12:23:10 +01:00
parent 128c5aa9bf
commit 92be2791ab

View file

@ -14,9 +14,11 @@ module Rack
if defined?(::Redis::Store) && store.is_a?(::Redis::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|
if defined?(::Dalli) && conn.is_a?(::Dalli::Client)
if conn.is_a?(::Dalli::Client)
DalliProxy.new(store)
else
raise NotImplementedError