mirror of
https://github.com/goharbor/harbor.git
synced 2024-12-22 08:38:03 +01:00
Merge pull request #12906 from steven-zou/fix/preheat-job
fix(preheat):handle fail case of preheat in job
This commit is contained in:
commit
bc3433194b
@ -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() {
|
||||
|
Loading…
Reference in New Issue
Block a user