Changeset

12009:f6fff0658108

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.
author Kim Alvefur <zash@zash.se>
date Sat, 04 Dec 2021 17:46:37 +0100
parents 12008:c01532ae6a3b
children 12010:f995d62044fa
files plugins/mod_cron.lua
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/mod_cron.lua	Sat Dec 04 16:48:39 2021 +0100
+++ b/plugins/mod_cron.lua	Sat Dec 04 17:46:37 2021 +0100
@@ -49,7 +49,7 @@
 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