diff --git a/bbot/modules/base.py b/bbot/modules/base.py index 6036c1463..01299c216 100644 --- a/bbot/modules/base.py +++ b/bbot/modules/base.py @@ -533,7 +533,8 @@ async def _setup(self): status = False self.debug(f"Setting up module {self.name}") try: - result = await self.setup() + setup_task = asyncio.create_task(self.setup()) + result = await setup_task if type(result) == tuple and len(result) == 2: status, msg = result else: @@ -600,7 +601,8 @@ async def _worker(self): if event.type == "FINISHED": context = f"{self.name}.finish()" async with self.scan._acatch(context), self._task_counter.count(context): - await self.finish() + finish_task = asyncio.create_task(self.finish()) + await finish_task else: context = f"{self.name}.handle_event({event})" self.scan.stats.event_consumed(event, self)