diff --git a/lib/synapse/service_watcher/zookeeper.rb b/lib/synapse/service_watcher/zookeeper.rb index 9b468f26..08cc32b2 100644 --- a/lib/synapse/service_watcher/zookeeper.rb +++ b/lib/synapse/service_watcher/zookeeper.rb @@ -365,9 +365,9 @@ def zk_connect log.info "synapse: ZK client has reconnected #{@name}" # random backoff to avoid checking and refreshing all watchers at the same time sleep rand(10) - now = Time.now + now = Time.now # ensure there is only one refresh can happen within a time window - if !@last_reconnect_time.nil? && (now - @last_connect_time) < 60 + if !@last_reconnect_time.nil? && (now - @last_reconnect_time) < 60 log.info "synapse: ZK client skip since last reconnect is too close #{@name}" return end