Merge pull request #12907 from steven-zou/cherry-pick/preheat-job-fix

[CHERRY-PICK]fix(preheat):handle fail case of preheat in job
This commit is contained in:
Steven Zou 2020-08-31 14:46:42 +08:00 committed by GitHub
commit 1e337a6fea
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)
// Finished
if s.Status == provider.PreheatingStatusSuccess {
switch s.Status {
case provider.PreheatingStatusFail:
// Fail
return preheatJobRunningError(errors.Errorf("preheat failed: %s", s))
case provider.PreheatingStatusSuccess:
// Finished
return nil
default:
// do nothing, check again
}
if shouldStop() {