Skip to content

Commit 1d34e4f

Browse files
committed
Fix status for entry
1 parent c4d210a commit 1d34e4f

1 file changed

Lines changed: 13 additions & 5 deletions

File tree

pkg/webui/webui.go

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -562,6 +562,8 @@ func aggregateEntries(groupName string, entries map[string]*entry) *entry {
562562
var idleChunks int64
563563
var maxPriority int64
564564
var hasFailed bool
565+
var hasRunning bool
566+
var hasPending bool
565567

566568
for uid, e := range entries {
567569
// Add member info to the list
@@ -571,8 +573,13 @@ func aggregateEntries(groupName string, entries map[string]*entry) *entry {
571573
Phase: e.Phase,
572574
})
573575

574-
if e.Phase == "Failed" {
576+
switch e.Phase {
577+
case "Failed":
575578
hasFailed = true
579+
case "Running":
580+
hasRunning = true
581+
case "Pending":
582+
hasPending = true
576583
}
577584

578585
if e.Priority > maxPriority {
@@ -607,13 +614,14 @@ func aggregateEntries(groupName string, entries map[string]*entry) *entry {
607614
aggregate.FailedChunks = failedChunks
608615
aggregate.Priority = maxPriority
609616

610-
switch {
617+
completed := pendingChunks == 0 && runningChunks == 0 && idleChunks == 0 && !hasRunning && !hasPending
611618

612-
case (hasFailed || failedChunks > 0) && pendingChunks == 0 && runningChunks == 0 && idleChunks == 0:
619+
switch {
620+
case completed && (hasFailed || failedChunks > 0):
613621
aggregate.Phase = "Failed"
614-
case succeededChunks == totalChunks && totalChunks > 0:
622+
case completed:
615623
aggregate.Phase = "Succeeded"
616-
case totalSize > 0:
624+
case hasRunning || hasPending:
617625
aggregate.Phase = "Running"
618626
default:
619627
aggregate.Phase = "Pending"

0 commit comments

Comments
 (0)