We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 01768da commit ae80708Copy full SHA for ae80708
lib/redis/client.rb
@@ -126,6 +126,8 @@ def connect
126
call [:auth, password]
127
end
128
129
+
130
+ call [:readonly] if @options[:readonly]
131
call [:select, db] if db != 0
132
call [:client, :setname, @options[:id]] if @options[:id]
133
@connector.check(self)
lib/redis/cluster/node.rb
@@ -76,8 +76,9 @@ def build_clients(options)
76
clients = options.map do |node_key, option|
77
next if replica_disabled? && slave?(node_key)
78
79
+ option = option.merge(readonly: true) if slave?(node_key)
80
81
client = Client.new(option)
- client.call(%i[readonly]) if slave?(node_key)
82
[node_key, client]
83
84
0 commit comments