# HG changeset patch # User Kim Alvefur # Date 1593459831 -7200 # Node ID d585deb8c882c7155cd3e3eefdbef886d0c7b2e8 # Parent 758ce12586de5f196661bf8076d08c1c4150b1a9 mod_admin_shell: Fix debug:timers to handle net.server native timers diff -r 758ce12586de -r d585deb8c882 plugins/mod_admin_shell.lua --- a/plugins/mod_admin_shell.lua Mon Jun 29 20:23:59 2020 +0200 +++ b/plugins/mod_admin_shell.lua Mon Jun 29 21:43:51 2020 +0200 @@ -1269,14 +1269,24 @@ local h, params = add_task.h, add_task.params; if h then print("-- util.timer"); + elseif server.timer then + print("-- net.server.timer"); + h = server.timer.add_task.timers; + end + if h then for i, id in ipairs(h.ids) do - if not params[id] then - print(os.date("%F %T", math.floor(h.priorities[i])), h.items[id]); - elseif not params[id].callback then - print(os.date("%F %T", math.floor(h.priorities[i])), h.items[id], unpack(params[id])); - else - print(os.date("%F %T", math.floor(h.priorities[i])), params[id].callback, unpack(params[id])); + local t, cb = h.priorities[i], h.items[id]; + if not params then + local param = cb.param; + if param then + cb = param.callback; + else + cb = cb.timer_callback or cb; + end + elseif params[id] then + cb = params[id].callback or cb; end + print(os.date("%F %T", math.floor(t)), cb); end end if server.event_base then