diff options
author | 2020-03-04 13:36:16 +0200 | |
---|---|---|
committer | 2020-03-04 13:36:16 +0200 | |
commit | 918c11fcba1a47f78ce17eb7278da294d95e314c (patch) | |
tree | 59bbf8ee69d70261b0d4e72cdacccca8a502c1fc | |
parent | (Games Cog): Added try block to genres refresh task. (diff) |
(Games Cog): Stop refreshing genres task when Cog unload
-rw-r--r-- | bot/seasons/evergreen/game.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/bot/seasons/evergreen/game.py b/bot/seasons/evergreen/game.py index 21c3b5d7..97df2bdb 100644 --- a/bot/seasons/evergreen/game.py +++ b/bot/seasons/evergreen/game.py @@ -157,6 +157,11 @@ class Games(Cog): return logger.info("Successfully refreshed genres.") + def cog_unload(self) -> None: + """Cancel genres refreshing start when unloading Cog.""" + self.refresh_genres_task.cancel() + logger.info("Successfully stopped Genres Refreshing task.") + async def _get_genres(self) -> None: """Create genres variable for games command.""" body = "fields name; limit 100;" |