File tree Expand file tree Collapse file tree 1 file changed +6
-12
lines changed Expand file tree Collapse file tree 1 file changed +6
-12
lines changed Original file line number Diff line number Diff line change @@ -11,9 +11,7 @@ class Client
11
11
:host => "127.0.0.1" ,
12
12
:port => 6379 ,
13
13
:path => nil ,
14
- :read_timeout => 5.0 ,
15
- :connect_timeout => 5.0 ,
16
- :write_timeout => nil ,
14
+ :timeout => 5.0 ,
17
15
:password => nil ,
18
16
:db => 0 ,
19
17
:driver => nil ,
@@ -436,18 +434,14 @@ def _parse_options(options)
436
434
end
437
435
438
436
if options . has_key? ( :timeout )
439
- options [ :read_timeout ] ||= options [ :timeout ]
440
437
options [ :connect_timeout ] ||= options [ :timeout ]
438
+ options [ :read_timeout ] ||= options [ :timeout ]
439
+ options [ :write_timeout ] ||= options [ :timeout ]
441
440
end
442
441
443
- options [ :read_timeout ] = options [ :read_timeout ] . to_f
444
- options [ :connect_timeout ] = if options [ :connect_timeout ]
445
- options [ :connect_timeout ] . to_f
446
- else
447
- options [ :read_timeout ]
448
- end
449
-
450
- options [ :write_timeout ] = options [ :write_timeout ] ? options [ :write_timeout ] . to_f : options [ :timeout ]
442
+ options [ :connect_timeout ] = Float ( options [ :connect_timeout ] )
443
+ options [ :read_timeout ] = Float ( options [ :read_timeout ] )
444
+ options [ :write_timeout ] = Float ( options [ :write_timeout ] )
451
445
452
446
options [ :db ] = options [ :db ] . to_i
453
447
options [ :driver ] = _parse_driver ( options [ :driver ] ) || Connection . drivers . last
You can’t perform that action at this time.
0 commit comments