mod_cron: Rename variable to fix shadowing (#luacheck)
authorMatthew Wild <mwild1@gmail.com>
Thu, 30 Nov 2023 11:42:52 +0000
changeset 13369 fda192db8f18
parent 13368 6f9b15757384
child 13370 9f1f1e7afdbd
mod_cron: Rename variable to fix shadowing (#luacheck)
plugins/mod_cron.lua
--- a/plugins/mod_cron.lua	Thu Nov 30 11:38:59 2023 +0000
+++ b/plugins/mod_cron.lua	Thu Nov 30 11:42:52 2023 +0000
@@ -82,7 +82,7 @@
 	name = "tasks";
 	desc = "View registered tasks";
 	args = {};
-	handler = function (self, host)
+	handler = function (self, filter_host)
 		local format_table = require "prosody.util.human.io".table;
 		local it = require "util.iterators";
 		local row = format_table({
@@ -94,7 +94,7 @@
 		}, self.session.width);
 		local print = self.session.print;
 		print(row());
-		for host in it.sorted_pairs(host and { [host]=true } or active_hosts) do
+		for host in it.sorted_pairs(filter_host and { [filter_host]=true } or active_hosts) do
 			for _, task in ipairs(module:context(host):get_host_items("task")) do
 				print(row { host, task.id, task.name, task.when, task.last and os.date("%Y-%m-%d %R:%S", task.last) or "never" });
 				--self.session.print(require "util.serialization".serialize(task, "debug"));