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

Queue Limiter Not Working #43

Open
dmillerSHQ opened this issue Nov 3, 2020 · 1 comment
Open

Queue Limiter Not Working #43

dmillerSHQ opened this issue Nov 3, 2020 · 1 comment

Comments

@dmillerSHQ
Copy link

dmillerSHQ commented Nov 3, 2020

I have a process that adds a single item to the queue and it works perfectly.

I have another process that adds 10 items to the queue, but they all process at the same time, I was expecting 1 at a time but can't get this process to work like this. What am I missing?

Working Code:

async handle (args, options) {
  // get env
  const appEnv = Config.get("app.environment");

  // get company id from cli argument
  const clientID = args.company;

  // Data to be passed to job handle
  const data = {
    id: clientID
  };
  this.info(`Queueing ${clientID} Job in ${appEnv}`);

  await Bull.add(Job.key, {
    id: clientID
  });

  this.info("Job Queued");

  process.exit();
}

If I modify that script and add the following, all 3 will process immediately, is there any way to change this?

await Bull.add(Job.key,{
  id: 1
});

await Bull.add(Job.key,{
  id: 2
});

await Bull.add(Job.key,{
  id: 3
});
@HigoRibeiro
Copy link
Contributor

I've run some tests and they were in sequential.

Did you change anything in the default options?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants