From a5479d7b0d1ca458b39c25f3615e6822a6600264 Mon Sep 17 00:00:00 2001 From: nemunaire Date: Sun, 16 Jul 2017 18:39:56 +0200 Subject: [PATCH] event: ensure that enough consumers are launched at the end of an event --- nemubot/bot.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/nemubot/bot.py b/nemubot/bot.py index 7ec3b30..ed46d48 100644 --- a/nemubot/bot.py +++ b/nemubot/bot.py @@ -207,6 +207,9 @@ class Bot(threading.Thread): elif action == "exit": self.quit() + elif action == "launch_consumer": + pass # This is treated after the loop + elif action == "loadconf": for path in args: logger.debug("Load configuration from %s", path) @@ -418,6 +421,7 @@ class Bot(threading.Thread): while len(self.events) > 0 and datetime.now(timezone.utc) >= self.events[0].current: evt = self.events.pop(0) self.cnsr_queue.put_nowait(EventConsumer(evt)) + sync_act("launch_consumer") self._update_event_timer()