Permalink
Browse files

the redis clients will receive all allowed options

  • Loading branch information...
1 parent 6d9754d commit 9d660f066f843f927b6cdc17767244c8c74870ed Thomas Dmytryk committed Nov 13, 2013
Showing with 6 additions and 1 deletion.
  1. +5 −1 lib/redis_failover/client.rb
  2. +1 −0 spec/client_spec.rb
View
6 lib/redis_failover/client.rb
@@ -345,7 +345,7 @@ def new_clients_for(*nodes)
opts = {:host => host, :port => port}
opts.update(:db => @db) if @db
opts.update(:password => @password) if @password
- client = Redis.new(opts)
+ client = Redis.new(@redis_client_options.merge(opts))
if @namespace
client = Redis::Namespace.new(@namespace, :redis => client)
end
@@ -503,6 +503,10 @@ def parse_options(options)
@safe_mode = options.fetch(:safe_mode, true)
@master_only = options.fetch(:master_only, false)
@verify_role = options.fetch(:verify_role, true)
+
+ @redis_client_options = Redis::Client::DEFAULTS.keys.each_with_object({}) do |key, hash|
+ hash[key] = options[key]
+ end
end
# @return [String] the znode path for the master redis nodes config
View
1 spec/client_spec.rb
@@ -2,6 +2,7 @@
module RedisFailover
Client::Redis = RedisStub
+ Client::Redis::Client = Redis::Client
class ClientStub < Client
def current_master
@master

0 comments on commit 9d660f0

Please sign in to comment.