From 5a02b3bc6b8bba269b824622046cf76d3389842d Mon Sep 17 00:00:00 2001 From: Chris Lovering Date: Thu, 31 Mar 2022 17:07:17 +0100 Subject: Remove BotBase.closing_tasks Doing a naive git log --grep closing_tasks on the bot repo I found these two places it was used: https://github.com/python-discord/bot/commit/429cc865309242f0cf37147f9c3f05036972eb8c - Reddit cog to revoke the access token on unload, which has since been moved to lance (without this feature). https://github.com/python-discord/bot/commit/f4004d814c1babfb5906afb8cd9944ceef90a2a3 - Silence cog, which has been removed since. Since this list of tasks to close when closing the Discord connection is no longer used, it has been removed from BotBase. --- botcore/_bot.py | 7 ------- 1 file changed, 7 deletions(-) (limited to 'botcore/_bot.py') diff --git a/botcore/_bot.py b/botcore/_bot.py index 82abbdc0..55923dd0 100644 --- a/botcore/_bot.py +++ b/botcore/_bot.py @@ -109,9 +109,6 @@ class BotBase(commands.Bot): attempt + 1 ) - # All tasks that need to block closing until finished - self.closing_tasks: list[asyncio.Task] = [] - async def load_extensions(self, module: types.ModuleType) -> None: """Load all the extensions within the given module and save them to ``self.all_extensions``.""" self.all_extensions = walk_extensions(module) @@ -240,10 +237,6 @@ class BotBase(commands.Bot): with suppress(Exception): await self.remove_cog(cog) - # Wait until all tasks that have to be completed before bot is closing is done - log.trace("Waiting for tasks before closing.") - await asyncio.gather(*self.closing_tasks) - # Now actually do full close of bot await super().close() -- cgit v1.2.3