Guide page has documentation issue for processors
Created by: psbyron3
Description
Hello,
I was getting started with bull (btw working great now!) and ran into an issue with my processor. I was attempting to repeat jobs with the cron
option within the repeat
object in add
method. My processor ran one job, then stopped. This turned out to be because I was accidentally passing a done callback into the processor and not returning it (using async/await instead). I thought this was a data
field per these docs I was following in the guide (under the Consumer section) :
const myFirstQueue = new Bull('my-first-queue');
// turns out data is actually the done callback.
myFirstQueue.process(async (job, data) => {
return doSomething(data);
});
I was able to figure out the issue by reading through your docs on the reference page. Would someone be able to update this part of the guide, so someone else doesn't fall down the rabbit hole I did?
Thanks in advance.
Minimal, Working Test code to reproduce the issue.
My old non-working code:
siteScrapeQueue.process('*', async (job, data) => {
// originally I was passing 'data' instead of 'job.data'
return await handleHistoricalScrape(job.data);
});
My new working code:
siteScrapeQueue.process('*', async (job) => {
return await handleHistoricalScrape(job.data);
});
(An easy to reproduce test case will dramatically decrease the resolution time.)
Bull version
3.5.2
Additional information
No code change necessary -- just update docs on guide page please.