Skip to content

Commit a814b5d

Browse files
authored
Mark batch job status properly (#5066)
Client side overall status was always shown as `in-progress` even if job was successful or failed. Signed-off-by: Shubhendu Ram Tripathi <shubhendu@minio.io>
1 parent 65aa514 commit a814b5d

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

cmd/batch-status.go

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,19 @@ func mainBatchStatus(ctx *cli.Context) error {
128128
return
129129
}
130130

131-
printMsg(batchJobStatusMessage{
131+
m := batchJobStatusMessage{
132132
Status: "in-progress",
133133
Metric: job,
134-
})
134+
}
135+
switch {
136+
case job.Complete:
137+
m.Status = "complete"
138+
case job.Failed:
139+
m.Status = "failed"
140+
default:
141+
// leave as is with in-progress
142+
}
143+
printMsg(m)
135144
if job.Complete || job.Failed {
136145
cancel()
137146
return

0 commit comments

Comments
 (0)