|
172 | 172 | const midY = H / 2; |
173 | 173 |
|
174 | 174 | const queues = this.filteredQueues.map((queue, i) => { |
175 | | - const node = this.findQueueNode(queue); |
176 | 175 | return { |
177 | | - id: node?.id ?? this.queueNodeId(queue), |
| 176 | + id: this.queueGraphId(queue), |
178 | 177 | type: 'queue', label: queue.name, sub: this.queueSubLabel(queue), |
179 | 178 | status: this.queueStatus(queue), |
180 | 179 | x: 205, y: this.distributedY(i, this.filteredQueues.length, qYMin, qYMax), |
|
324 | 323 | let jobClass = null; |
325 | 324 |
|
326 | 325 | if (node.type === 'job') { |
327 | | - queue = this.queues.find(q => this.queueNodeId(q) === node.queueId) ?? null; |
| 326 | + queue = this.queues.find(q => this.queueGraphId(q) === node.queueId) ?? null; |
328 | 327 | if (queue) { |
329 | 328 | jobClass = this.queueJobClasses(queue).find(c => c.name === node.name) ?? null; |
330 | 329 | } |
|
674 | 673 |
|
675 | 674 | queueJobNodes() { |
676 | 675 | return this.filteredQueues.flatMap(queue => { |
677 | | - const queueId = this.queueNodeId(queue); |
| 676 | + const queueId = this.queueGraphId(queue); |
678 | 677 |
|
679 | 678 | if (this.zoom >= 1.35) { |
680 | 679 | return (queue.jobs ?? []) |
|
806 | 805 | return `queue-${queue.driver}-${queue.connection}-${queue.name}`.replace(/[^a-z0-9-]+/gi, '-').toLowerCase(); |
807 | 806 | }, |
808 | 807 |
|
| 808 | + // The graph node id a queue actually renders under: the backend's id |
| 809 | + // when the payload carries one, otherwise the local fallback. Job |
| 810 | + // nodes and the inspector must resolve queues through the same id, |
| 811 | + // or their edges never connect to the queue they belong to. |
| 812 | + queueGraphId(queue) { |
| 813 | + return this.findQueueNode(queue)?.id ?? this.queueNodeId(queue); |
| 814 | + }, |
| 815 | +
|
809 | 816 | queueStatus(queue) { |
810 | 817 | if (this.queueFailedInWindow(queue) > 0) return 'critical'; |
811 | 818 | if (queue.wait_seconds >= 30 || queue.pending >= 500) return 'critical'; |
|
0 commit comments