From 72c5ac4054d5a12d0781a626d0ed875d8dd22324 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Thu, 6 Apr 2023 14:17:50 +0100 Subject: 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. --- plugins/mod_debug_reset.lua | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/plugins/mod_debug_reset.lua b/plugins/mod_debug_reset.lua index 9ff465eb..eb54c400 100644 --- a/plugins/mod_debug_reset.lua +++ b/plugins/mod_debug_reset.lua @@ -18,18 +18,16 @@ local function do_reset() 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 -- cgit v1.2.3