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:
parent
ac06985604
commit
36512eca29
2 changed files with 2 additions and 2 deletions
plugins
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue