From 36512eca292578726109ceeb3ee8e1293102fd29 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Tue, 22 Feb 2022 14:17:27 +0100 Subject: 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. --- plugins/mod_c2s.lua | 2 +- plugins/mod_s2s.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'plugins') diff --git a/plugins/mod_c2s.lua b/plugins/mod_c2s.lua index 8b06fe8a..c8f54fa7 100644 --- a/plugins/mod_c2s.lua +++ b/plugins/mod_c2s.lua @@ -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) diff --git a/plugins/mod_s2s.lua b/plugins/mod_s2s.lua index e539082d..ed91844c 100644 --- a/plugins/mod_s2s.lua +++ b/plugins/mod_s2s.lua @@ -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) -- cgit v1.2.3