bull
bull copied to clipboard
threaded processes are not passed the queue information
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.
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.