aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar ks129 <[email protected]>2020-05-01 15:51:08 +0300
committerGravatar ks129 <[email protected]>2020-05-01 15:51:08 +0300
commit28fb3b83461f9375133ae8cfed6018f7b84c4a7e (patch)
tree6913625209348da732eaa6bb7e2e4e3e9cc83783
parentReplace message ID storage to new specific ID storage in `News` cog (diff)
Added on cog unload news posting tasks canceling on `News` cog
-rw-r--r--bot/cogs/news.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/bot/cogs/news.py b/bot/cogs/news.py
index c5b89cf57..ecc8edaf3 100644
--- a/bot/cogs/news.py
+++ b/bot/cogs/news.py
@@ -217,6 +217,11 @@ class News(Cog):
await self.start_tasks()
+ def cog_unload(self) -> None:
+ """Stop news posting tasks on cog unload."""
+ self.post_pep_news.cancel()
+ self.post_maillist_news.cancel()
+
def setup(bot: Bot) -> None:
"""Add `News` cog."""