Skip to content

'removed' event inconsistent parameter #2115

@aste-mikkok

Description

@aste-mikkok

According to REFERENCE.md:

.on('removed', function (job) {
  // A job successfully removed.
});

In job.js this event is emited with job id here:

Job.remove = async function(queue, pattern) {
  await queue.isReady();
  const removed = await scripts.removeWithPattern(queue, pattern);
  removed.forEach(jobId => queue.emit('removed', jobId));
};

And with the full Job object here:

Job.prototype.remove = function() {
  const queue = this.queue;
  const job = this;

  return queue.isReady().then(() => {
    return scripts.remove(queue, job.id).then(removed => {
      if (removed) {
        queue.emit('removed', job);
      } else {
        throw new Error('Could not remove job ' + job.id);
      }
    });
  });
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions