diff --git a/lib/responders/bull-responders.ts b/lib/responders/bull-responders.ts index bec11c4..b6e3c4a 100644 --- a/lib/responders/bull-responders.ts +++ b/lib/responders/bull-responders.ts @@ -17,7 +17,7 @@ function paginate( start = start || 0; end = end || -1; return (queue) - [method](start, end, opts) + [method](start, end, opts) .then(function (jobs: Bull.Job[]) { respond(ws, messageId, jobs); }); @@ -100,10 +100,13 @@ async function respondQueueCommand( case "getCompletedCount": case "getFailedCount": case "getRepeatableCount": - case "getWorkersCount": const count = await (queue)[data.cmd](); respond(ws, msg.id, count); break; + case "getWorkersCount": + const workers = await queue.getWorkers(); + respond(ws, msg.id, workers.length); + break; case "removeRepeatableByKey": await queue.removeRepeatableByKey(data.key); respond(ws, msg.id); diff --git a/lib/responders/bullmq-responders.ts b/lib/responders/bullmq-responders.ts index f508d3f..1aa8140 100644 --- a/lib/responders/bullmq-responders.ts +++ b/lib/responders/bullmq-responders.ts @@ -101,10 +101,13 @@ async function respondQueueCommand( case "getCompletedCount": case "getFailedCount": case "getRepeatableCount": - case "getWorkersCount": const count = await (queue)[data.cmd](); respond(ws, msg.id, count); break; + case "getWorkersCount": + const workers = await queue.getWorkers(); + respond(ws, msg.id, workers.length); + break; case "removeRepeatableByKey": await queue.removeRepeatableByKey(data.key); respond(ws, msg.id);