diff options
author | 2020-02-25 22:34:35 -0800 | |
---|---|---|
committer | 2020-02-25 22:34:35 -0800 | |
commit | e173cd2af20b546230ed467f26286ee167df55cd (patch) | |
tree | 026ffd0225eac4cdf6a2d2250d0b0e04849dbdc7 | |
parent | Scheduler: properly raise task's exception the done callback (diff) |
Scheduler: only send warning in callback if task isn't cancelled
If a task is cancelled it is assumed it was done via cancel_task. That
method deletes the task after cancelling so the warning isn't relevant.
-rw-r--r-- | bot/utils/scheduling.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/bot/utils/scheduling.py b/bot/utils/scheduling.py index 742133f02..9371dcdb7 100644 --- a/bot/utils/scheduling.py +++ b/bot/utils/scheduling.py @@ -87,7 +87,7 @@ class Scheduler(metaclass=CogABCMeta): f"{self.cog_name}: the scheduled task #{task_id} {id(scheduled_task)} " f"and the done task {id(done_task)} differ." ) - else: + elif not done_task.cancelled(): log.warning( f"{self.cog_name}: task #{task_id} not found while handling task {id(done_task)}! " f"A task somehow got unscheduled improperly (i.e. deleted but not cancelled)." |