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

get groups sometimes returns empty array #36

Open
jaroslaw-weber opened this issue Jan 17, 2023 · 1 comment
Open

get groups sometimes returns empty array #36

jaroslaw-weber opened this issue Jan 17, 2023 · 1 comment

Comments

@jaroslaw-weber
Copy link

im not sure why but this was happening to me today. version: 5.1.10

const max = 2;
  const groupKey1 = 'A';
  const groupKey2 = 'B';
  for (let i = 0; i < 200; i++) {
    await bullProTestQueue.add(
      `test-${groupKey1}`,
      { groupKey: groupKey1 /*, priority: 5*/ },
      { jobId: uuidv4(), group: { id: groupKey1 } },
    );
    await bullProTestQueue.add(
      `test-${groupKey2}`,
      { groupKey: groupKey2 /*, priority: 5*/ },
      { jobId: uuidv4(), group: { id: groupKey2 } },
    );
  }
  const jobs = await bullProTestQueue.getJobs();
  const getGroups = await bullProTestQueue.getGroups();
  if (getGroups.length !== 2) {
    throw new Error('Group is not created');
  }

getGroups.length was 0. flushing redis didn't work. eventually it worked but i didn't do big change to the code.

@roggervalf
Copy link
Collaborator

This is weird, did you face the same behavior in more updated versions?

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