Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • B bull
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 175
    • Issues 175
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 9
    • Merge requests 9
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OptimalBits
  • bull
  • Issues
  • #1204
Closed
Open
Issue created Jan 31, 2019 by Administrator@rootContributor

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.

Assignee
Assign to
Time tracking