aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar MarkKoz <[email protected]>2020-02-24 12:27:02 -0800
committerGravatar MarkKoz <[email protected]>2020-03-22 15:54:34 -0700
commitc5892c76f257cf14ddfad5cb4ccf47ff86623a47 (patch)
treee9335be1bb24c2bea428767058f8277de2aff980
parentHelpChannels: cancel the init task when unloading the cog (diff)
HelpChannels: set a ready event when cog initialisation completes
-rw-r--r--bot/cogs/help_channels.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/bot/cogs/help_channels.py b/bot/cogs/help_channels.py
index 3865183b0..6dd689727 100644
--- a/bot/cogs/help_channels.py
+++ b/bot/cogs/help_channels.py
@@ -56,6 +56,7 @@ class HelpChannels(Scheduler, commands.Cog):
self.channel_queue: asyncio.Queue = None
self.name_queue: deque = None
+ self.ready = asyncio.Event()
self.init_task = asyncio.create_task(self.init_cog())
async def cog_unload(self) -> None:
@@ -108,6 +109,8 @@ class HelpChannels(Scheduler, commands.Cog):
await self.init_available()
await self.move_idle_channels()
+ self.ready.set()
+
async def move_idle_channels(self) -> None:
"""Make all idle in-use channels dormant."""