This commit is contained in:
oitsjustjose 2023-04-30 12:00:51 -05:00
commit f3dc9bb001
3 changed files with 78 additions and 59 deletions

View file

@ -17,12 +17,12 @@ export default async (req: Request, res: Response) => {
// Determine how many items in the queue are ahead of this one
const aheadInQueue = await Jobs.find({
queue_place: { $lt: job.queuePlace },
queue_place: { $lte: job.queuePlace },
});
let text: string = "";
if (job.status == Status.ENQUEUED) {
text = `Enqueued: ${aheadInQueue.length} Job(s) ahead in queue`;
text = `Enqueued: ${aheadInQueue.length + 1} Job(s) ahead in queue`;
} else if (job.status == Status.PROCESSING) {
text = `Currently Processing\n${job.logs}`;
} else if (job.status == Status.COMPLETE) {