# HG changeset patch
# User Matthew Wild <mwild1@gmail.com>
# Date 1736273189 0
# Node ID 899453f11f50cf4fdcfadbd6388ccb0eddb94cbd
# Parent  fdb2e0568cf8e036e9e5fc065fc51ed141fbea6d
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.

diff -r fdb2e0568cf8 -r 899453f11f50 plugins/mod_cron.lua
--- a/plugins/mod_cron.lua	Tue Jan 07 14:41:32 2025 +0000
+++ b/plugins/mod_cron.lua	Tue Jan 07 18:06:29 2025 +0000
@@ -8,6 +8,10 @@
 
 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");