Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[15.0][PORT] 533 from 14.0 (jobrunner cancelled state) #534

Merged
merged 1 commit into from
May 4, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions queue_job/jobrunner/channels.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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)
Expand Down