diff options
| author | 2021-02-10 21:50:18 +0100 | |
|---|---|---|
| committer | 2021-02-10 21:50:18 +0100 | |
| commit | 3b2a509085b0ae79d6ca428960f7b6b82d94be18 (patch) | |
| tree | 8f79212958e9cfb608d3951b3b59b1ae49f83302 | |
| parent | Add permanent streaming command (diff) | |
Fix cancelling tasks on cog unload
| -rw-r--r-- | bot/exts/moderation/stream.py | 5 |
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: |