From 77e264372816f22f96eb936149da0a901b7dc846 Mon Sep 17 00:00:00 2001 From: hong Date: Wed, 17 Apr 2019 11:42:03 +0800 Subject: [PATCH] =?UTF-8?q?=E9=81=BF=E5=85=8D=E5=A4=B1=E8=B4=A5=E5=8D=A1?= =?UTF-8?q?=E4=BD=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit add pcall --- lualib/skynet/cluster.lua | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lualib/skynet/cluster.lua b/lualib/skynet/cluster.lua index 926d387f..e32569f4 100644 --- a/lualib/skynet/cluster.lua +++ b/lualib/skynet/cluster.lua @@ -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