Skip to content

Commit 20203f4

Browse files
authored
Merge pull request #2 from GustavoCaso/improve-program-state-logic
Improve program state logic
2 parents 680c9c2 + 45fb006 commit 20203f4

3 files changed

Lines changed: 107 additions & 95 deletions

File tree

cmd/meeseeks/utils.go

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -137,15 +137,6 @@ func formatStatisticsAsTable(data any, programName string) error {
137137
if stats.HasInterval {
138138
interval = stats.Interval.String()
139139
}
140-
status := "idle"
141-
//nolint:gocritic // using switch would not improve readbility
142-
if running > 0 {
143-
status = "running"
144-
} else if failed > 0 && successful == 0 {
145-
status = "failed"
146-
} else if successful > 0 {
147-
status = "completed"
148-
}
149140

150141
fmt.Fprintf(w, "%s\t%d\t%d\t%d\t%d\t%s\t%s\n",
151142
truncateString(name, 20),
@@ -154,7 +145,7 @@ func formatStatisticsAsTable(data any, programName string) error {
154145
failed,
155146
running,
156147
truncateString(interval, 10),
157-
status)
148+
stats.State)
158149
}
159150

160151
return w.Flush()

0 commit comments

Comments
 (0)