1
0
Fork 0
mirror of https://github.com/bjc/prosody.git synced 2025-04-06 22:57:38 +03:00

mod_c2s,mod_s2s: Fix error on shutdown (Thanks Martin)

Since there are two calls to done() that can happen, if the timing is
right (or wrong) both can happen, which previously triggered an error.
This commit is contained in:
Kim Alvefur 2022-02-22 14:17:27 +01:00
parent ac06985604
commit 36512eca29
2 changed files with 2 additions and 2 deletions

View file

@ -433,7 +433,7 @@ module:hook("server-stopping", function(event) -- luacheck: ignore 212/event
end, -80);
module:hook("server-stopping", function(event)
local wait, done = async.waiter();
local wait, done = async.waiter(1, true);
module:hook("c2s-closed", function ()
if next(sessions) == nil then done(); end
end)

View file

@ -973,7 +973,7 @@ module:hook("server-stopping", function(event)
end
end
local wait, done = async.waiter();
local wait, done = async.waiter(1, true);
module:hook("s2s-closed", function ()
if next(sessions) == nil then done(); end
end, 1)