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:
parent
599f72bc6e
commit
674157d8dd
1 changed files with 4 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue