diff options
author | 2022-03-31 17:07:17 +0100 | |
---|---|---|
committer | 2022-03-31 20:53:42 +0100 | |
commit | 5a02b3bc6b8bba269b824622046cf76d3389842d (patch) | |
tree | 3093f2e3f2b6b6fd274db1f3defb1b21b83fdc27 /botcore | |
parent | Add __all__ attrs to async_stats and site_api modules (diff) |
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.
Diffstat (limited to 'botcore')
-rw-r--r-- | botcore/_bot.py | 7 |
1 files changed, 0 insertions, 7 deletions
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() |