From 1081178eb67b0706c1706f452e562c6ad1edb77a Mon Sep 17 00:00:00 2001 From: MarkKoz Date: Fri, 11 Oct 2019 14:43:46 -0700 Subject: Cancel the periodic ping task when the verification cog is unloaded --- bot/cogs/verification.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bot/cogs/verification.py b/bot/cogs/verification.py index 204981d80..74e1b333b 100644 --- a/bot/cogs/verification.py +++ b/bot/cogs/verification.py @@ -184,6 +184,10 @@ class Verification(Cog): """Only start the loop when the bot is ready.""" await self.bot.wait_until_ready() + def cog_unload(self) -> None: + """Cancel the periodic ping task when the cog is unloaded.""" + self.periodic_ping.cancel() + def setup(bot: Bot) -> None: """Verification cog load.""" -- cgit v1.2.3