Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix for logging when connection reconfigured

* Host & port in Connection are only used for logging purposes
  • Loading branch information...
commit 213eb0aa23b250b878b7f32837d878a11fae6062 1 parent c3cd21f
@mloughran authored
Showing with 6 additions and 1 deletion.
  1. +1 −1  lib/em-hiredis/base_client.rb
  2. +5 −0 lib/em-hiredis/connection.rb
View
2  lib/em-hiredis/base_client.rb
@@ -175,9 +175,9 @@ def method_missing(sym, *args)
end
def reconnect
- EventMachine::Hiredis.logger.debug("Trying to reconnect to Redis")
@reconnecting = true
@connection.reconnect @host, @port
+ EM::Hiredis.logger.info("#{@connection.to_s} reconnecting")
end
def handle_reply(reply)
View
5 lib/em-hiredis/connection.rb
@@ -9,6 +9,11 @@ def initialize(host, port)
@host, @port = host, port
end
+ def reconnect(host, port)
+ super
+ @host, @port = host, port
+ end
+
def connection_completed
EM::Hiredis.logger.debug("#{to_s}: connection open")
@reader = ::Hiredis::Reader.new
Please sign in to comment.
Something went wrong with that request. Please try again.