summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2018-12-05 14:33:48 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2018-12-05 14:33:48 +0000
commit8feff3e587c05658f5c9ccab3decb12208decc71 (patch)
tree46407a84bd833394a01f58ce5d38ffee53bf701d
parent70d859cede253e512d9f968178b3155bf927a68f (diff)
downloadrspamd-8feff3e587c05658f5c9ccab3decb12208decc71.tar.gz
rspamd-8feff3e587c05658f5c9ccab3decb12208decc71.zip
[Minor] Skip broken slaves retrieved from sentinel
Issue: #2667
-rw-r--r--lualib/lua_redis.lua8
1 files changed, 5 insertions, 3 deletions
diff --git a/lualib/lua_redis.lua b/lualib/lua_redis.lua
index 0c6520e5c..658e26242 100644
--- a/lualib/lua_redis.lua
+++ b/lualib/lua_redis.lua
@@ -137,9 +137,11 @@ local function redis_query_sentinel(ev_base, params, initialised)
)
for _,slave in ipairs(master.slaves) do
- read_servers_tbl[#read_servers_tbl + 1] = string.format(
- '%s:%s', slave.ip, slave.port
- )
+ if slave['master-link-status'] == 'ok' then
+ read_servers_tbl[#read_servers_tbl + 1] = string.format(
+ '%s:%s', slave.ip, slave.port
+ )
+ end
end
end