Skip to content

Getters

Source URL: https://docs.bullmq.io/bullmq-pro/groups/getters

It is often necessary to know how many jobs are in any group:

import { QueuePro } from '@taskforcesh/bullmq-pro';
const queue = new QueuePro('myQueue', { connection });
const groupId = 'my group';
const count = await queue.getGroupsJobsCount(1000); // 1000 groups in each iteration

{% hint style=“info” %} This count value includes prioritized and non-prioritized jobs included groups. {% endhint %}

Or if you want to get active jobs count for an specific group

const activeCount = await queue.getGroupActiveCount(groupId);

It is also possible to retrieve the jobs with pagination style semantics in a given group. For example:

const jobs = await queue.getGroupJobs(groupId, 0, 100);