From 155db8120811b89624fb7e657818eb32ed07301a Mon Sep 17 00:00:00 2001 From: Pratik Naik Date: Tue, 14 Apr 2015 13:21:26 -0500 Subject: Revert "Remove all the existing connections on redis reconnect" This reverts commit 4ac6cfefbb84a6b6ae095c20e990e5807caa9105. --- lib/action_cable/connection/base.rb | 4 ---- lib/action_cable/server.rb | 13 +------------ 2 files changed, 1 insertion(+), 16 deletions(-) diff --git a/lib/action_cable/connection/base.rb b/lib/action_cable/connection/base.rb index 93db5b3dba..e8126f3d75 100644 --- a/lib/action_cable/connection/base.rb +++ b/lib/action_cable/connection/base.rb @@ -100,10 +100,6 @@ module ActionCable end def handle_exception - close_connection - end - - def close_connection logger.error "Closing connection" @websocket.close diff --git a/lib/action_cable/server.rb b/lib/action_cable/server.rb index 70b0610e92..1780e0c028 100644 --- a/lib/action_cable/server.rb +++ b/lib/action_cable/server.rb @@ -24,18 +24,7 @@ module ActionCable end def pubsub - @pubsub ||= redis.pubsub - end - - def redis - @redis ||= begin - redis = EM::Hiredis.connect(@redis_config[:url]) - redis.on(:reconnected) do - logger.info "[ActionCable] Redis reconnected. Closing all the open connections." - @connections.map &:close_connection - end - redis - end + @pubsub ||= EM::Hiredis.connect(@redis_config[:url]).pubsub end def threaded_redis -- cgit v1.2.3