From d58c6ae7ca37c591411f72217676a52183bcf126 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Tue, 7 Jan 2025 18:06:29 +0000 Subject: mod_cron: Don't run tasks if loaded inside prosodyctl It's common for modules to depend on mod_cron, and this can lead to it loading inside prosodyctl, where we don't really want to run any cron tasks. --- plugins/mod_cron.lua | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'plugins') diff --git a/plugins/mod_cron.lua b/plugins/mod_cron.lua index 29c1aa93..67b68514 100644 --- a/plugins/mod_cron.lua +++ b/plugins/mod_cron.lua @@ -8,6 +8,10 @@ local cron_spread_factor = module:get_option_number("cron_spread_factor", 0); local active_hosts = {} +if prosody.process_type == "prosodyctl" then + return; -- Yes, it happens... +end + function module.add_host(host_module) local last_run_times = host_module:open_store("cron", "map"); -- cgit v1.2.3