🔢 Getting job counts
This commit is contained in:
@@ -196,6 +196,11 @@ export default class JobQueueService extends Service {
|
|||||||
});
|
});
|
||||||
// 6. Purge it from Redis
|
// 6. Purge it from Redis
|
||||||
await job.remove();
|
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.`);
|
console.log(`Job ID ${ctx.params.id} completed.`);
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -223,18 +228,6 @@ export default class JobQueueService extends Service {
|
|||||||
], //optional
|
], //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",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
});
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user