plugins/mod_admin_shell.lua
changeset 13342 470ab6b55e93
parent 13338 aefcb6b4f47d
child 13353 d5d4e386c6fb
--- a/plugins/mod_admin_shell.lua	Tue Nov 21 22:18:17 2023 +0100
+++ b/plugins/mod_admin_shell.lua	Tue Nov 21 22:18:42 2023 +0100
@@ -2017,18 +2017,11 @@
 
 function def_env.debug:async(runner_id)
 	local print = self.session.print;
-	local async = require "prosody.util.async";
-	local time_now = require "prosody.util.time".now();
-
-	local function format_time(t)
-		return os.date("%F %T", math.floor(normalize_time(t)));
-	end
+	local time_now = time.now();
 
 	if runner_id then
-		local matched;
 		for runner, since in pairs(async.waiting_runners) do
 			if runner.id == runner_id then
-				matched = runner;
 				print("ID        ", runner.id);
 				local f = runner.func;
 				if f == async.default_runner_func then
@@ -2039,7 +2032,7 @@
 						print("Stanza:")
 						print("\t"..runner.current_item:indent(2):pretty_print());
 					else
-						print("Work item", serialize(runner.current_item, "debug"));
+						print("Work item", self.session.serialize(runner.current_item, "debug"));
 					end
 				end
 
@@ -2054,7 +2047,12 @@
 		return nil, "Runner not found or is currently idle";
 	end
 
-	local row = format_table({ { title = "ID", width = 12 }, { title = "Function", width = "10p" }, { title = "Status", width = "16" }, { title = "Location", width = "10p" } }, self.session.width);
+	local row = format_table({
+		{ title = "ID"; width = 12 };
+		{ title = "Function"; width = "10p" };
+		{ title = "Status"; width = "16" };
+		{ title = "Location"; width = "10p" };
+	}, self.session.width);
 	print(row())
 
 	local c = 0;