feat(managed-job): add restore from failed state
This commit is contained in:
@@ -45,7 +45,7 @@ func (job *ManagedJob) cycle() {
|
||||
return
|
||||
}
|
||||
// Check for set running or error state
|
||||
if job.state.Status == JobStatusCreating {
|
||||
if job.state.Status == JobStatusCreating || job.state.Status == JobStatusFailing {
|
||||
err := job.checkStatus()
|
||||
if errors.Is(err, ErrNoJobId) {
|
||||
job.state = nil
|
||||
@@ -67,5 +67,10 @@ func (job *ManagedJob) cycle() {
|
||||
}
|
||||
return
|
||||
}
|
||||
if job.state.Status == JobStatusFailed {
|
||||
job.restore()
|
||||
return
|
||||
}
|
||||
lc.Logger.Warn("[managed-job] [cycle]", zap.String("unhanded job status", string(job.state.Status)))
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user