Merge pull request from steven-zou/fix/preheat-job

fix(preheat):handle fail case of preheat in job
This commit is contained in:
Steven Zou 2020-08-31 11:15:15 +08:00 committed by GitHub
commit bc3433194b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -185,9 +185,15 @@ func (j *Job) Run(ctx job.Context, params job.Parameters) error {
myLogger.Infof("Check preheat progress: %s", s)
switch s.Status {
case provider.PreheatingStatusFail:
// Fail
return preheatJobRunningError(errors.Errorf("preheat failed: %s", s))
case provider.PreheatingStatusSuccess:
// Finished
if s.Status == provider.PreheatingStatusSuccess {
return nil
default:
// do nothing, check again
}
if shouldStop() {