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.
2 parents a5c1cee + 98cc390 commit af0b66cCopy full SHA for af0b66c
lib/redis/client.rb
@@ -115,7 +115,17 @@ def connect
115
# Don't try to reconnect when the connection is fresh
116
with_reconnect(false) do
117
establish_connection
118
- call [:auth, username, password].compact if username || password
+ if password
119
+ if username
120
+ begin
121
+ call [:auth, username, password]
122
+ rescue CommandError # Likely on Redis < 6
123
+ call [:auth, password]
124
+ end
125
+ else
126
127
128
129
call [:select, db] if db != 0
130
call [:client, :setname, @options[:id]] if @options[:id]
131
@connector.check(self)
0 commit comments