This commit is contained in:
DeSqBlocki committed 2025-12-06 15:31:13 +01:00
1 parent 566a8e5905
commit cb61ad08c7
12 files changed
+145 -374

No files matched your search

+16 -3
View File
@@ -102,18 +102,31 @@ exports.status = async (req, res) => {
const db = await getDb();
const queued = await db.collection("queue")
.find({}).sort({ created_at: 1 }).toArray();
.find({ $or: [ { processing: { $exists: false } }, { processing: false } ] })
.sort({ created_at: 1 })
.toArray();
const processing = await db.collection("queue")
.find({ processing: true })
.sort({ created_at: 1 })
.toArray();
const done = await db.collection("done")
.find({}).sort({ finished_at: -1 }).toArray();
.find({})
.sort({ finished_at: -1 })
.toArray();
const failed = await db.collection("failed")
.find({}).sort({ failed_at: -1 }).toArray();
.find({})
.sort({ failed_at: -1 })
.toArray();
res.render("status", {
title: "Queue Status",
queued,
processing,
finished: done,
failed
});
};