diff options
| author | 2020-07-31 18:04:38 +0300 | |
|---|---|---|
| committer | 2020-07-31 18:04:38 +0300 | |
| commit | 2dc0ee180330bcf2687d62e174abeea79e963775 (patch) | |
| tree | 5f85cc35416db56485511332876acf6dfeac4260 | |
| parent | Simplify bot shutdown cogs removing (diff) | |
Use asyncio.gather instead manual looping and awaiting
| -rw-r--r-- | bot/bot.py | 5 |
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() |