job.returnvalue not populated in 3.0.0-rc.2
Created by: gswalden
After upgrading to 3.0.0-rc.2
, I noticed the returnvalue
property is no longer populated. See these two demonstrations.
const Queue = require('bull');
const doneQueue = new Queue('testing callback');
function doneResult(id) {
setTimeout(function() {
doneQueue.getJobFromId(id).then(job => {
console.log('callback job returnvalue', job.returnvalue);
})
}, 1000)
}
doneQueue.process((job, done) => {
doneResult(job.id);
done(null, 'callback result string');
})
doneQueue.add({ testing: true });
const Queue = require('bull');
const promiseQueue = new Queue('testing promise');
function promiseResult(id) {
setTimeout(function () {
promiseQueue.getJobFromId(id).then(job => {
console.log('promise job returnvalue', job.returnvalue);
})
}, 1000)
}
promiseQueue.process(job => {
promiseResult(job.id);
return Promise.resolve('promise result string');
})
promiseQueue.add({ testing: true });
Upon inspecting the job
object returned from getJobFromId()
, I did not see any new properties containing the string I passed to done()
.