Skip to content

Commit

Permalink
Stop waiting if the job is in terminal state
Browse files Browse the repository at this point in the history
  • Loading branch information
nyergler committed Apr 28, 2023
1 parent fcb881d commit 0fb754b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions bulk/job.go
Original file line number Diff line number Diff line change
Expand Up @@ -461,11 +461,13 @@ func (j *Job) Wait(ctx context.Context) (Info, error) {
errs <- err
return
}
if status.State == JobComplete {
switch status.State {
case JobComplete,
Failed,
Aborted:
completed <- status
return
}

}
}()
select {
Expand Down

0 comments on commit 0fb754b

Please sign in to comment.