aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Harbys <[email protected]>2021-02-10 21:50:18 +0100
committerGravatar Harbys <[email protected]>2021-02-10 21:50:18 +0100
commit3b2a509085b0ae79d6ca428960f7b6b82d94be18 (patch)
tree8f79212958e9cfb608d3951b3b59b1ae49f83302
parentAdd permanent streaming command (diff)
Fix cancelling tasks on cog unload
-rw-r--r--bot/exts/moderation/stream.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/bot/exts/moderation/stream.py b/bot/exts/moderation/stream.py
index 46c68f74b..c61599278 100644
--- a/bot/exts/moderation/stream.py
+++ b/bot/exts/moderation/stream.py
@@ -129,8 +129,9 @@ class Stream(commands.Cog):
await ctx.send(f"{Emojis.cross_mark} This user already can't stream.")
def cog_unload(self) -> None:
- """Cache and cancel all scheduled tasks."""
- self.scheduler.cancel_all()
+ """Cancel all scheduled tasks."""
+ self.reload_task.cancel()
+ self.reload_task.add_done_callback(lambda _: self.scheduler.cancel_all())
def setup(bot: Bot) -> None: