# HG changeset patch # User Kim Alvefur # Date 1638636397 -3600 # Node ID f6fff06581087a3645c28dbaa4f362b11c847bd1 # Parent c01532ae6a3bb76267e8fb5cf8b264aa7cb21a84 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. diff -r c01532ae6a3b -r f6fff0658108 plugins/mod_cron.lua --- 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