From fe9fbe9c3a2da47ba273c2079cf1ddc194b8a0fd Mon Sep 17 00:00:00 2001 From: Rishi Ghan Date: Tue, 22 Aug 2023 00:04:47 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A2=20Getting=20job=20counts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- services/jobqueue.service.ts | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/services/jobqueue.service.ts b/services/jobqueue.service.ts index f3028ed..1df1381 100644 --- a/services/jobqueue.service.ts +++ b/services/jobqueue.service.ts @@ -196,6 +196,11 @@ export default class JobQueueService extends Service { }); // 6. Purge it from Redis await job.remove(); + + // 7. Check + const jobCounts = this.getJobCounts("active", "completed", "failed"); + console.log("ASDASD"); + console.log(jobCounts); console.log(`Job ID ${ctx.params.id} completed.`); }, @@ -223,18 +228,6 @@ export default class JobQueueService extends Service { ], //optional }); }, - async "enqueue.async.drained"(ctx) { - console.log(`Queue drained, all jobs processed.`); - await this.broker.call("socket.broadcast", { - namespace: "/", - event: "action", - args: [ - { - type: "LS_IMPORT_QUEUE_DRAINED", - }, - ], - }); - }, }, }); }