1
0
Fork 0
mirror of https://github.com/mperham/connection_pool synced 2023-03-27 23:22:21 -04:00

Better hack to support Redis 3.2.1+, #67

This commit is contained in:
Mike Perham 2015-02-25 14:15:23 -08:00
parent 599f72bc6e
commit 674157d8dd

View file

@ -126,8 +126,11 @@ class ConnectionPool::TimedStack
if @shutdown_block
@shutdown_block.call(obj)
else
if obj.respond_to?(:close)
# try to shut down the connection before throwing it away
if obj.respond_to?(:close) # Dalli::Client
obj.close rescue nil
elsif obj.respond_to?(:disconnect!) # Redis
obj.disconnect! rescue nil
end
@created -= 1
end