Changeset

10878:b37dc3776f69

mod_admin_shell: Fix error due to float passed to os.date in Lua 5.3 Thanks Martin
author Kim Alvefur <zash@zash.se>
date Tue, 02 Jun 2020 16:40:23 +0200
parents 10877:2b015ef8cd06
children 10879:5c7bb2440f53
files plugins/mod_admin_shell.lua
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/mod_admin_shell.lua	Tue Jun 02 09:35:07 2020 +0200
+++ b/plugins/mod_admin_shell.lua	Tue Jun 02 16:40:23 2020 +0200
@@ -1273,11 +1273,11 @@
 		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 @@
 	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;