mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-10-19 06:07:21 +02:00
fix: send queue job payloads to the admin page as objects
BullMQ's asJSON() stringifies data, failedReason, stacktrace and returnvalue. The Queues page reads them as objects, so payload repo IDs never showed, failure reasons kept their JSON quotes, and a stack trace rendered one block per character. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
fd1bce74b4
commit
cfd7b73de4
2 files changed
+42
-1
No files matched your search
@@ -381,7 +381,16 @@ router.get("/queues", dashboardCache, async (req, res) => {
|
||||
...QUEUE_STATES.map(async (state) => {
|
||||
const jobs = await targetQueue.getJobs([state], 0, 199);
|
||||
return jobs.map((j) => {
|
||||
const json: Record<string, unknown> = { ...j.asJSON(), _state: state };
|
||||
// asJSON() serializes these fields to strings; the dashboard needs
|
||||
// the objects (payload repoId, stack lines, failure reason).
|
||||
const json: Record<string, unknown> = {
|
||||
...j.asJSON(),
|
||||
data: j.data,
|
||||
failedReason: j.failedReason,
|
||||
stacktrace: j.stacktrace,
|
||||
returnvalue: j.returnvalue,
|
||||
_state: state,
|
||||
};
|
||||
if (state === "delayed" && j.delay > 0) {
|
||||
json.delayUntil = j.timestamp + j.delay;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user