aboutsummaryrefslogtreecommitdiffstats
path: root/bot/seasons/christmas/adventofcode.py
diff options
context:
space:
mode:
authorGravatar scragly <[email protected]>2019-12-03 00:02:37 +1000
committerGravatar GitHub <[email protected]>2019-12-03 00:02:37 +1000
commitb61f78193b325e978c3bb12200c1caeea9cbbac4 (patch)
tree14a64725b050a316256457bef265a8e5657d8142 /bot/seasons/christmas/adventofcode.py
parentAdds the monsterbio command (#303) (diff)
parentDelete whitespaces (diff)
Cancel season related tasks on cog unload (#320)
Cancel season related tasks on cog unload
Diffstat (limited to 'bot/seasons/christmas/adventofcode.py')
-rw-r--r--bot/seasons/christmas/adventofcode.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/bot/seasons/christmas/adventofcode.py b/bot/seasons/christmas/adventofcode.py
index 3750964a..fe2fa956 100644
--- a/bot/seasons/christmas/adventofcode.py
+++ b/bot/seasons/christmas/adventofcode.py
@@ -407,6 +407,11 @@ class AdventOfCode(commands.Cog):
else:
self.cached_private_leaderboard = await AocPrivateLeaderboard.from_url()
+ def cog_unload(self) -> None:
+ """Cancel season-related tasks on cog unload."""
+ self.countdown_task.cancel()
+ self.status_task.cancel()
+
class AocMember:
"""Object representing the Advent of Code user."""