mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-24 20:23:06 +00:00
ignore break sessions, See issue #1413
This commit is contained in:
@@ -968,8 +968,10 @@ function skynet.task(ret)
|
|||||||
if ret == nil then
|
if ret == nil then
|
||||||
local t = 0
|
local t = 0
|
||||||
for session,co in pairs(session_id_coroutine) do
|
for session,co in pairs(session_id_coroutine) do
|
||||||
|
if co ~= "BREAK" then
|
||||||
t = t + 1
|
t = t + 1
|
||||||
end
|
end
|
||||||
|
end
|
||||||
return t
|
return t
|
||||||
end
|
end
|
||||||
if ret == "init" then
|
if ret == "init" then
|
||||||
@@ -983,7 +985,9 @@ function skynet.task(ret)
|
|||||||
if tt == "table" then
|
if tt == "table" then
|
||||||
for session,co in pairs(session_id_coroutine) do
|
for session,co in pairs(session_id_coroutine) do
|
||||||
local key = string.format("%s session: %d", tostring(co), session)
|
local key = string.format("%s session: %d", tostring(co), session)
|
||||||
if timeout_traceback and timeout_traceback[co] then
|
if co == "BREAK" then
|
||||||
|
ret[key] = "BREAK"
|
||||||
|
elseif timeout_traceback and timeout_traceback[co] then
|
||||||
ret[key] = timeout_traceback[co]
|
ret[key] = timeout_traceback[co]
|
||||||
else
|
else
|
||||||
ret[key] = traceback(co)
|
ret[key] = traceback(co)
|
||||||
@@ -993,7 +997,11 @@ function skynet.task(ret)
|
|||||||
elseif tt == "number" then
|
elseif tt == "number" then
|
||||||
local co = session_id_coroutine[ret]
|
local co = session_id_coroutine[ret]
|
||||||
if co then
|
if co then
|
||||||
|
if co == "BREAK" then
|
||||||
|
return "BREAK"
|
||||||
|
else
|
||||||
return traceback(co)
|
return traceback(co)
|
||||||
|
end
|
||||||
else
|
else
|
||||||
return "No session"
|
return "No session"
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user