Skip to content

Commit 5a02b3b

Browse files
committed
Remove BotBase.closing_tasks
Doing a naive git log --grep closing_tasks on the bot repo I found these two places it was used: python-discord/bot@429cc86 - Reddit cog to revoke the access token on unload, which has since been moved to lance (without this feature). python-discord/bot@f4004d8 - 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.
1 parent 8e1e881 commit 5a02b3b

File tree

1 file changed

+0
-7
lines changed

1 file changed

+0
-7
lines changed

botcore/_bot.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,6 @@ def _connect_statsd(
109109
attempt + 1
110110
)
111111

112-
# All tasks that need to block closing until finished
113-
self.closing_tasks: list[asyncio.Task] = []
114-
115112
async def load_extensions(self, module: types.ModuleType) -> None:
116113
"""Load all the extensions within the given module and save them to ``self.all_extensions``."""
117114
self.all_extensions = walk_extensions(module)
@@ -240,10 +237,6 @@ async def close(self) -> None:
240237
with suppress(Exception):
241238
await self.remove_cog(cog)
242239

243-
# Wait until all tasks that have to be completed before bot is closing is done
244-
log.trace("Waiting for tasks before closing.")
245-
await asyncio.gather(*self.closing_tasks)
246-
247240
# Now actually do full close of bot
248241
await super().close()
249242

0 commit comments

Comments
 (0)