diff --git a/src/statusbot/bot.py b/src/statusbot/bot.py index a5df8a2..1441efe 100644 --- a/src/statusbot/bot.py +++ b/src/statusbot/bot.py @@ -1997,6 +1997,7 @@ async def process_command_message( midx = int(mode.lower() == "guild") if self.stopped.is_set() and midx: + # Ignore if shutting down and in guild await message.channel.send( f"{__title__} is in the process of shutting down.", ) @@ -2161,9 +2162,11 @@ async def close(self) -> None: # await asyncio.gather(*coros) print("Waiting to acquire updating lock...\n") - with self.updating: - print("Closing...") - await discord.Client.close(self) + while self.updating.locked(): + print("Mid update, waiting for complete...") + await asyncio.sleep(1) + print("Closing...") + await discord.Client.close(self) def setup_bot(loop: asyncio.AbstractEventLoop) -> tuple[