lib/redis.rb in redis-5.0.7 vs lib/redis.rb in redis-5.0.8
- old
+ new
@@ -43,11 +43,11 @@
# `redis://:[password]@[hostname]:[port]/[db]` (password, port and database are optional), for a unix socket
# connection: `unix://[path to Redis socket]`. This overrides all other options.
# @option options [String] :host ("127.0.0.1") server hostname
# @option options [Integer] :port (6379) server port
# @option options [String] :path path to server socket (overrides host and port)
- # @option options [Float] :timeout (5.0) timeout in seconds
+ # @option options [Float] :timeout (1.0) timeout in seconds
# @option options [Float] :connect_timeout (same as timeout) timeout for initial connect in seconds
# @option options [String] :username Username to authenticate against server
# @option options [String] :password Password to authenticate against server
# @option options [Integer] :db (0) Database to select after connect and on reconnects
# @option options [Symbol] :driver Driver to use, currently supported: `:ruby`, `:hiredis`
@@ -135,24 +135,9 @@
if options.key?(:cluster)
raise "Redis Cluster support was moved to the `redis-clustering` gem."
end
if options.key?(:sentinels)
- if url = options.delete(:url)
- uri = URI.parse(url)
- if !options.key?(:name) && uri.host
- options[:name] = uri.host
- end
-
- if !options.key?(:password) && uri.password && !uri.password.empty?
- options[:password] = uri.password
- end
-
- if !options.key?(:username) && uri.user && !uri.user.empty?
- options[:username] = uri.user
- end
- end
-
Client.sentinel(**options).new_client
else
Client.config(**options).new_client
end
end