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.process() - concurrency incorrect #2108

Closed
alucky4eg opened this issue Jul 19, 2021 · 1 comment
Closed

queue.process() - concurrency incorrect #2108

alucky4eg opened this issue Jul 19, 2021 · 1 comment

Comments

@alucky4eg
Copy link

alucky4eg commented Jul 19, 2021

Description

queue.process('name', concurrency) - concurrency stacks up for all queue.

why do not use limiter here? this setting is the same with limiter.max

Minimal, Working Test code to reproduce the issue.

import Bull from 'bull';
import { EQueue } from '../../interfaces';

const p = async job => {
  console.log(`[${job.id}] STARTED ${job.data}`);
  await new Promise(resolve => setTimeout(resolve, 5_000));
  console.log(`[${job.id}] FINISHED ${job.data}`);
  return;
};

(async () => {
  const options: Bull.QueueOptions = {
    limiter: {
      max: 100,
      duration: 1000,
      bounceBack: false,
    },
  };
  const queue = new Bull(EQueue.system, options);

  queue.process('test', 5, p);
  queue.process('test1', 100, p);

  const actions = [];
  for (let i = 0; i < 100; i++)
    actions.push(i);

  await queue.addBulk(actions.map(_ => ({ name: 'test', data: _ })));
})();

Bull version

3.26.0

Additional information

i think this property should affect only process, not all queue

@manast
Copy link
Member

manast commented Jul 21, 2021

This is the intended behaviour even if it feels unnatural, there are no plans to change it for the time being: https://github.com/OptimalBits/bull/blob/develop/REFERENCE.md#queueprocess

@manast manast closed this as completed Jul 21, 2021
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