From d48fa1de17cf1435ae733053b8e65e295f2b622f Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sat, 4 Dec 2021 17:46:37 +0100 Subject: mod_cron: Expose the One Timer via module environment This makes it easier to reschedule or otherwise manipulate the timer from e.g. the shell, which is handy for debugging. --- plugins/mod_cron.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugins/mod_cron.lua') diff --git a/plugins/mod_cron.lua b/plugins/mod_cron.lua index cbb551e8..f18d3a9a 100644 --- a/plugins/mod_cron.lua +++ b/plugins/mod_cron.lua @@ -49,7 +49,7 @@ local function run_task(task) end local task_runner = async.runner(run_task); -module:add_timer(1, function() +scheduled = module:add_timer(1, function() module:log("info", "Running periodic tasks"); local delay = 3600; for host in pairs(active_hosts) do -- cgit v1.2.3