lib/ruby_skynet/zookeeper/registry.rb in ruby_skynet-1.2.4 vs lib/ruby_skynet/zookeeper/registry.rb in ruby_skynet-1.2.5

- old
+ new

@@ -39,14 +39,11 @@ # # :on_connect [Proc] # Block to call after the connection to Zookeeper has been established # and every time the connection is re-established # - # :registry [Hash|ZooKeeper] - # ZooKeeper configuration information, or an existing - # ZooKeeper ( ZooKeeper client) instance - # + # :registry [Hash] # :servers [Array of String] # Array of URL's of ZooKeeper servers to connect to with port numbers # ['server1:2181', 'server2:2181'] # # :connect_timeout [Float] @@ -73,10 +70,10 @@ # Strip trailing '/' if supplied @root = @root[0..-2] if @root.end_with?("/") @root_with_trail = "#{@root}/" @root = '/' if @root == '' - registry_config = params.delete(:registry) || {} + registry_config = (params.delete(:registry) || {}).dup # server1:2181,server2:2181,server3:2181 @servers = (registry_config.delete(:servers) || ['127.0.0.1:2181']).join(',') @connect_timeout = (registry_config.delete(:connect_timeout) || 10).to_f \ No newline at end of file