Skip to content

Commit 48bfce6

Browse files
authored
try_hosts's connect_to_host no need select(db).
1 parent 12e20b4 commit 48bfce6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/resty/redis/connector.lua

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,9 @@ function _M.connect_to_host(self, host)
235235
end
236236
end
237237

238-
r:select(host.db)
238+
if host.db ~= nil then
239+
r:select(host.db)
240+
end
239241
return r, nil
240242
end
241243
end

0 commit comments

Comments
 (0)