File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -157,7 +157,12 @@ local function parse_dsn(params)
157157 local parsed_params = {}
158158
159159 for i ,v in ipairs (fields ) do
160- parsed_params [v ] = m [i + 1 ]
160+ if v == " db" or v == " port" then
161+ parsed_params [v ] = tonumber (m [i + 1 ])
162+ else
163+ parsed_params [v ] = m [i + 1 ]
164+ end
165+
161166 if v == " role" then
162167 parsed_params [v ] = roles [parsed_params [v ]]
163168 end
@@ -362,6 +367,7 @@ function _M.connect_to_host(self, host)
362367 -- No support for DBs in proxied Redis.
363368 if config .connection_is_proxied ~= true and host .db ~= nil then
364369 local res , err = r :select (host .db )
370+
365371 -- SELECT will fail if we are connected to sentinel:
366372 -- detect it and ignore error message it that's the case
367373 if err and str_find (err , " ERR unknown command" ) then
You can’t perform that action at this time.
0 commit comments