From 753836c876d5060cbc7e0c2029597abaae844eed Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Tue, 2 Jun 2020 16:40:23 +0200 Subject: mod_admin_shell: Fix error due to float passed to os.date in Lua 5.3 Thanks Martin --- plugins/mod_admin_shell.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/mod_admin_shell.lua b/plugins/mod_admin_shell.lua index a9ca797c..fd88f59c 100644 --- a/plugins/mod_admin_shell.lua +++ b/plugins/mod_admin_shell.lua @@ -1273,11 +1273,11 @@ function def_env.debug:timers() print("-- util.timer"); for i, id in ipairs(h.ids) do if not params[id] then - print(os.date("%F %T", h.priorities[i]), h.items[id]); + print(os.date("%F %T", math.floor(h.priorities[i])), h.items[id]); elseif not params[id].callback then - print(os.date("%F %T", h.priorities[i]), h.items[id], unpack(params[id])); + print(os.date("%F %T", math.floor(h.priorities[i])), h.items[id], unpack(params[id])); else - print(os.date("%F %T", h.priorities[i]), params[id].callback, unpack(params[id])); + print(os.date("%F %T", math.floor(h.priorities[i])), params[id].callback, unpack(params[id])); end end end @@ -1293,7 +1293,7 @@ function def_env.debug:timers() if h then local next_time = h:peek(); if next_time then - return true, os.date("Next event at %F %T (in %%.6fs)", next_time):format(next_time - time.now()); + return true, os.date("Next event at %F %T (in %%.6fs)", math.floor(next_time)):format(next_time - time.now()); end end return true; -- cgit v1.2.3