mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-24 20:23:06 +00:00
clusterd wait for cluster.reload when the name no exist
This commit is contained in:
@@ -26,7 +26,16 @@ local function open_channel(t, key)
|
||||
end
|
||||
ct = {}
|
||||
connecting[key] = ct
|
||||
local host, port = string.match(node_address[key], "([^:]+):(.*)$")
|
||||
local address = node_address[key]
|
||||
if address == nil then
|
||||
local co = coroutine.running()
|
||||
assert(ct.namequery == nil)
|
||||
ct.namequery = co
|
||||
skynet.error("Wating for cluster node [".. key.."]")
|
||||
skynet.wait(co)
|
||||
address = assert(node_address[key])
|
||||
end
|
||||
local host, port = string.match(address, "([^:]+):(.*)$")
|
||||
local c = sc.channel {
|
||||
host = host,
|
||||
port = tonumber(port),
|
||||
@@ -67,6 +76,11 @@ local function loadconfig(tmp)
|
||||
end
|
||||
node_address[name] = address
|
||||
end
|
||||
local ct = connecting[name]
|
||||
if ct and ct.namequery then
|
||||
skynet.error(string.format("Cluster node [%s] resloved : %s", name, address))
|
||||
skynet.wakeup(ct.namequery)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user