mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-22 02:53:09 +00:00
fix #1246
This commit is contained in:
@@ -31,10 +31,10 @@ local function list_srv(ti, fmt_func, ...)
|
||||
req:add(r)
|
||||
sessions[r] = addr
|
||||
end
|
||||
for resp, req in req:select(ti) do
|
||||
for req, resp in req:select(ti) do
|
||||
local stat = resp[1]
|
||||
local addr = req[1]
|
||||
if resp.ok then
|
||||
if resp then
|
||||
list[skynet.address(addr)] = fmt_func(stat, addr)
|
||||
else
|
||||
list[skynet.address(addr)] = fmt_func("ERROR", addr)
|
||||
@@ -62,8 +62,8 @@ end
|
||||
function command.MEM(addr, ti)
|
||||
return list_srv(ti, function(kb, addr)
|
||||
local v = services[addr]
|
||||
if kb == "TIMEOUT" then
|
||||
return string.format("TIMEOUT (%s)",v)
|
||||
if type(kb) == "string" then
|
||||
return string.format("%s (%s)", kb, v)
|
||||
else
|
||||
return string.format("%.2f Kb (%s)",kb,v)
|
||||
end
|
||||
@@ -74,7 +74,7 @@ function command.GC(addr, ti)
|
||||
for k,v in pairs(services) do
|
||||
skynet.send(k,"debug","GC")
|
||||
end
|
||||
return command.MEM(ti)
|
||||
return command.MEM(addr, ti)
|
||||
end
|
||||
|
||||
function command.REMOVE(_, handle, kill)
|
||||
|
||||
Reference in New Issue
Block a user