Skip to content

Job cancellation #42

Description

@noxify

Extracted feature request from #41


  • a new status cancelled
  • a new field cancelledAt
  • a new method cancelJob on queue level, which can be called to trigger the cancellation ( and sets the status + cancelledAt )
  • a new event job:cancelled
  • a new event job:cancel:{jobId}

To process the cancellation, we're extending the processJob and processBatchJobs and listen to the job:cancel:${jobId} event and stop the processing ( inside processJob we just have to extend the Promise.race.

For processBatchJobs, we have to modify the current implementation ( maybe, we just have to call processJob from processBatchJobs 🤔 ).

it's similar to the current timeout implementation.


Note: We should also check if an AbortController ( as @maelp mention here: #41 (comment) ) could work.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions