aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bot/cogs/help_channels.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/bot/cogs/help_channels.py b/bot/cogs/help_channels.py
index 1e99f16b5..3865183b0 100644
--- a/bot/cogs/help_channels.py
+++ b/bot/cogs/help_channels.py
@@ -56,7 +56,11 @@ class HelpChannels(Scheduler, commands.Cog):
self.channel_queue: asyncio.Queue = None
self.name_queue: deque = None
- asyncio.create_task(self.init_cog())
+ self.init_task = asyncio.create_task(self.init_cog())
+
+ async def cog_unload(self) -> None:
+ """Cancel the init task if the cog unloads."""
+ self.init_task.cancel()
async def create_channel_queue(self) -> asyncio.Queue:
"""Return a queue of dormant channels to use for getting the next available channel."""