Skip to content

Commit 40fa58f

Browse files
committed
Merge branch 'master' of github.com:taskforcesh/taskforce-connector
2 parents ea56690 + f07db90 commit 40fa58f

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

lib/responders/bull-responders.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ function paginate(
1717
start = start || 0;
1818
end = end || -1;
1919
return (<any>queue)
20-
[method](start, end, opts)
20+
[method](start, end, opts)
2121
.then(function (jobs: Bull.Job[]) {
2222
respond(ws, messageId, jobs);
2323
});
@@ -100,10 +100,13 @@ async function respondQueueCommand(
100100
case "getCompletedCount":
101101
case "getFailedCount":
102102
case "getRepeatableCount":
103-
case "getWorkersCount":
104103
const count = await (<any>queue)[data.cmd]();
105104
respond(ws, msg.id, count);
106105
break;
106+
case "getWorkersCount":
107+
const workers = await queue.getWorkers();
108+
respond(ws, msg.id, workers.length);
109+
break;
107110
case "removeRepeatableByKey":
108111
await queue.removeRepeatableByKey(data.key);
109112
respond(ws, msg.id);

lib/responders/bullmq-responders.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,13 @@ async function respondQueueCommand(
101101
case "getCompletedCount":
102102
case "getFailedCount":
103103
case "getRepeatableCount":
104-
case "getWorkersCount":
105104
const count = await (<any>queue)[data.cmd]();
106105
respond(ws, msg.id, count);
107106
break;
107+
case "getWorkersCount":
108+
const workers = await queue.getWorkers();
109+
respond(ws, msg.id, workers.length);
110+
break;
108111
case "removeRepeatableByKey":
109112
await queue.removeRepeatableByKey(data.key);
110113
respond(ws, msg.id);

0 commit comments

Comments
 (0)