🔢 Getting job counts

This commit is contained in:
2023-08-22 00:04:47 -04:00
parent df6652cce9
commit fe9fbe9c3a

View File

@@ -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",
},
],
});
},
},
});
}