Skip to content

Commit 241de60

Browse files
committed
Added missing auth feature. Fixes #1
1 parent a67eb97 commit 241de60

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

lib/resty/redis/connector.lua

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,15 @@ function _M.connect_to_host(self, host)
209209
return nil, err
210210
else
211211
r:set_timeout(self, self.read_timeout)
212+
213+
if host.password then
214+
local res, err = r:auth(host.password)
215+
if err then
216+
ngx_log(ngx_ERR, err)
217+
return res, err
218+
end
219+
end
220+
212221
r:select(host.db)
213222
return r, nil
214223
end

0 commit comments

Comments
 (0)