Prioritized intra-groups
BullMQ Pro supports priorities per group. A job is prioritized in a group when group and priority options are provided together.
await myQueue.add(
'paint',
{ foo: 'bar' },
{
group: {
id: 'groupId',
priority: 10,
},
},
);Get Counts per Priority for Group
If you want to get the count of jobs in prioritized status (priorities higher than 0) or in waiting status (priority 0) for specific group, use the getCountsPerPriorityForGroup method. For example, let's say that you want to get counts for priority 1 and 0:
const counts = await queue.getCountsPerPriorityForGroup('groupId', [1, 0]);
/*
{
'1': 11,
'0': 10
}
*/Read more:
Last updated
Was this helpful?