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 4a208ec commit aff76fcCopy full SHA for aff76fc
lib/resty/redis/sentinel.lua
@@ -39,7 +39,11 @@ function _M.get_slaves(sentinel, master_name)
39
host[slave[i]] = slave[i + 1]
40
end
41
42
- if host["master-link-status"] == "ok" then
+ local master_link_status_ok = host["master-link-status"] == "ok"
43
+ local is_down = host["flags"] and (string.find(host["flags"],"s_down")
44
+ or string.find(host["flags"],"o_down")
45
+ or string.find(host["flags"],"disconnected"))
46
+ if master_link_status_ok and not is_down then
47
host.host = host.ip -- for parity with other functions
48
tbl_insert(hosts, host)
49
0 commit comments