避免失败卡住

add pcall
This commit is contained in:
hong
2019-04-17 11:42:03 +08:00
committed by 云风
parent 9ba0860c70
commit 77e2643728

View File

@@ -11,16 +11,19 @@ local function get_sender(t, node)
local co=coroutine.running()
table.insert(waitco, co)
skynet.wait(co)
return rawget(t, node)
return assert(rawget(t, node))
else
waitco = {}
inquery_name[node] = waitco
local c = skynet.call(clusterd, "lua", "sender", node)
local ok,c = pcall(skynet.call, clusterd, "lua", "sender", node)
if ok then
t[node] = c
end
inquery_name[node] = nil
t[node] = c
for _, co in ipairs(waitco) do
skynet.wakeup(co)
end
assert(ok,c)
return c
end
end