diff options
author | 2019-12-02 10:03:43 +0100 | |
---|---|---|
committer | 2019-12-02 10:03:43 +0100 | |
commit | 8c01aea64030ae49c1a14f1a633633915c1a28a6 (patch) | |
tree | 8a13185bad9d0782e6672d2073eb84708607c1da /bot/seasons/christmas/adventofcode.py | |
parent | Adds the monsterbio command (#303) (diff) |
Cancel season related tasks on cog unload
Diffstat (limited to 'bot/seasons/christmas/adventofcode.py')
-rw-r--r-- | bot/seasons/christmas/adventofcode.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/bot/seasons/christmas/adventofcode.py b/bot/seasons/christmas/adventofcode.py index 3750964a..818e5748 100644 --- a/bot/seasons/christmas/adventofcode.py +++ b/bot/seasons/christmas/adventofcode.py @@ -406,6 +406,11 @@ class AdventOfCode(commands.Cog): self.cached_global_leaderboard = await AocGlobalLeaderboard.from_url() 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: |