aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar ks129 <[email protected]>2020-07-31 18:04:38 +0300
committerGravatar GitHub <[email protected]>2020-07-31 18:04:38 +0300
commit2dc0ee180330bcf2687d62e174abeea79e963775 (patch)
tree5f85cc35416db56485511332876acf6dfeac4260
parentSimplify bot shutdown cogs removing (diff)
Use asyncio.gather instead manual looping and awaiting
-rw-r--r--bot/bot.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/bot/bot.py b/bot/bot.py
index 5e05d1596..2f366a3ef 100644
--- a/bot/bot.py
+++ b/bot/bot.py
@@ -106,9 +106,8 @@ class Bot(commands.Bot):
self.remove_extensions()
# Wait until all tasks that have to be completed before bot is closing is done
- for task in self.closing_tasks:
- log.trace(f"Waiting for task {task.get_name()} before closing.")
- await task
+ log.trace("Waiting for tasks before closing.")
+ await asyncio.gather(*self.closing_tasks)
# Now actually do full close of bot
await super(commands.Bot, self).close()