Permalink
Browse files

only register for callback if in safe_mode

  • Loading branch information...
1 parent 8ef4e12 commit 7f063ffc5f8ad213f7faa0c1135e38ab7167c6e3 @ryanlecompte committed Aug 13, 2012
Showing with 3 additions and 1 deletion.
  1. +3 −1 lib/redis_failover/client.rb
@@ -140,7 +140,9 @@ def reconnect
def setup_zk
@zk = ZK.new(@zkservers)
@zk.watcher.register(@znode) { |event| handle_zk_event(event) }
- @zk.on_expired_session { purge_clients if @safe_mode }
+ if @safe_mode
+ @zk.on_expired_session { purge_clients }
+ end
@zk.on_connected { @zk.stat(@znode, :watch => true) }
@zk.stat(@znode, :watch => true)
update_znode_timestamp

0 comments on commit 7f063ff

Please sign in to comment.