diff --git a/queue_job/jobrunner/channels.py b/queue_job/jobrunner/channels.py index 1b306d723d..2b6f78483f 100644 --- a/queue_job/jobrunner/channels.py +++ b/queue_job/jobrunner/channels.py @@ -7,7 +7,7 @@ from weakref import WeakValueDictionary from ..exception import ChannelNotFound -from ..job import DONE, ENQUEUED, FAILED, PENDING, STARTED, WAIT_DEPENDENCIES +from ..job import CANCELLED, DONE, ENQUEUED, FAILED, PENDING, STARTED, WAIT_DEPENDENCIES NOT_DONE = (WAIT_DEPENDENCIES, PENDING, ENQUEUED, STARTED, FAILED) @@ -1046,7 +1046,7 @@ def notify( job = ChannelJob(db_name, channel, uuid, seq, date_created, priority, eta) self._jobs_by_uuid[uuid] = job # state transitions - if not state or state == DONE: + if not state or state in (DONE, CANCELLED): job.channel.set_done(job) elif state == PENDING: job.channel.set_pending(job)