Skip to content

Commit

Permalink
Normalize the job queue latency's value
Browse files Browse the repository at this point in the history
  fix goharbor#21354

Signed-off-by: stonezdj <[email protected]>
  • Loading branch information
stonezdj committed Dec 24, 2024
1 parent d7ab265 commit 77756a4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/controller/jobmonitor/monitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -267,10 +267,15 @@ func (w *monitorController) ListQueues(ctx context.Context) ([]*jm.Queue, error)
if skippedUnusedJobType(queue.JobName) {
continue
}
// normalize latency, it sometimes return -1
var latency int64
if queue.Latency > 0 {
latency = queue.Latency
}
result = append(result, &jm.Queue{
JobType: queue.JobName,
Count: queue.Count,
Latency: queue.Latency,
Latency: latency,
Paused: statusMap[queue.JobName],
})
}
Expand Down

0 comments on commit 77756a4

Please sign in to comment.