Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can not add Queue in other queue #131

Closed
ghost opened this issue Feb 9, 2020 · 2 comments
Closed

Can not add Queue in other queue #131

ghost opened this issue Feb 9, 2020 · 2 comments

Comments

@ghost
Copy link

ghost commented Feb 9, 2020

I cannot create one job to create a bulk jobs. Does it not support, or have I forgotten something?
Please help for this case.

const { Queue, Worker } = require('bullmq');
const bulk = new Queue('fetchAll');
async function addJobs(){
      await bulk.add('fetchAll', ['link1', 'link2']);
}
addJobs();
const workerBulk = new Worker('fetchAll', async job => {
      const links = job.data;
      for(const link of links ) await one.add('fetch', link);
});
const one = new Queue('fetch');
const workerOne = new Worker('fetch', async job => {
      // handle One
});

Error:

TypeError: Cannot read property 'add' of undefined

@willoughby
Copy link

You need to define your queues at the beginning, I’m have queues adding jobs to other queues with no ptoblem

@willoughby
Copy link

Without a stacktrace one is not defined in time

manast added a commit that referenced this issue Nov 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants