Skip to content

Allow passing next(error, job) to both cancel and update #67

@viridia

Description

@viridia

When processing a job, I sometimes want to both update the job and cancel it - such as setting a code indicating the reason for cancellation. The code for this tends to look like this:

job.cancelReson = Cancellation.USER;
job.update();
const error = new JobError('canceled');
error.cancelJob = true;
next(error);

However, presumably the 'next' method is going to mutate the job record. It would be convenient to be able to do both in a single database update.

My proposal would be that passing both parameters (error and job) to next() would accomplish this.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions