diff options
-rw-r--r-- | lualib/lua_redis.lua | 8 |
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 |