This commit is contained in:
云风
2021-07-15 09:35:31 +08:00
committed by GitHub
parent 39e0aaa27e
commit 72a6182601
2 changed files with 26 additions and 6 deletions

View File

@@ -59,8 +59,13 @@ local function read_response(sock)
end
function command.changenode(host, port)
channel:changehost(host, tonumber(port))
channel:connect(true)
if not host then
skynet.error(string.format("Close cluster sender %s:%d", channel.__host, channel.__port))
channel:close()
else
channel:changehost(host, tonumber(port))
channel:connect(true)
end
skynet.ret(skynet.pack(nil))
end