Skip to content

Commit

Permalink
Small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jasrusable committed Jul 11, 2021
1 parent ed804de commit 5a5db1d
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions src/request-handlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,20 @@ export const registerRequestHandlers = ({
name: request.data.queueName,
prefix: request.data.queuePrefix,
});
const jobCounts = await queue.bull.getJobCounts();
return jobCounts;
const jobCounts = await queue.bull.getJobCounts(
'wait',
'active',
'completed',
'failed',
'delayed',
);
return {
waiting: jobCounts.wait,
active: jobCounts.active,
completed: jobCounts.completed,
failed: jobCounts.failed,
delayed: jobCounts.delayed,
};
};

const getWaiting = async (request: Request) => {
Expand Down Expand Up @@ -114,7 +126,7 @@ export const registerRequestHandlers = ({
});
const job = await queue.bull.getJob(request.data.jobId);
const state = await job?.getState();
return { ...job, state };
return { ...job, state, queue: undefined };
};

const pauseQueue = async (request: Request) => {
Expand Down

0 comments on commit 5a5db1d

Please sign in to comment.