bull icon indicating copy to clipboard operation
bull copied to clipboard

threaded processes are not passed the queue information

Open zsalzbank opened this issue 5 years ago • 1 comments

Description

When running a non-threaded job, the job object passed to the processor has a reference to the queue that the job is running on.

However, running that same job in a threaded process would result in a failure, because the queue key is not set in the job.

Minimal, Working Test code to reproduce the issue.

module.exports = function processJob(job) {
  return job.queue.name;
} 

Bull version

3.11.0

Additional information

I think this happens because the Queue class can't be serialized. But it would be helpful to serialize as much information about it as possible and pass it to the job.

zsalzbank avatar Nov 07 '19 16:11 zsalzbank

As you mentioned this works as designed. It would be possible to create a proxy for the queue too, but its out of the scope for the moment.

manast avatar Nov 07 '19 17:11 manast