Changeset

13028:b2e6a175537d

mod_debug_reset: Don't delay operations until next tick For some unknown reason, this was required with the old mock util.time functions prior to 012d6e7b723a. After 012d6e7b723a, it breaks. So I'm happy to revert to not delaying anything. This makes tests pass again.
author Matthew Wild <mwild1@gmail.com>
date Thu, 06 Apr 2023 14:17:50 +0100
parents 13027:012d6e7b723a
children 13029:8ad432953300
files plugins/mod_debug_reset.lua
diffstat 1 files changed, 4 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/mod_debug_reset.lua	Thu Apr 06 14:00:54 2023 +0100
+++ b/plugins/mod_debug_reset.lua	Thu Apr 06 14:17:50 2023 +0100
@@ -18,18 +18,16 @@
 	module:fire_event("server-resetting");
 	for _, host in ipairs(hosts) do
 		hostmanager.deactivate(host);
-		timer.add_task(0, function ()
-			hostmanager.activate(host);
-			module:log("info", "Reset complete");
-			module:fire_event("server-reset");
-		end);
+		hostmanager.activate(host);
+		module:log("info", "Reset complete");
+		module:fire_event("server-reset");
 	end
 end
 
 function module.add_host(host_module)
 	host_module:hook("resource-unbind", function ()
 		if next(prosody.full_sessions) == nil then
-			timer.add_task(0, do_reset);
+			do_reset();
 		end
 	end);
 end