Merge pull request #15292 from gouqi11/fix/modelartsStatus

fix(region):modelarts task
This commit is contained in:
Zexi Li
2022-11-04 15:27:15 +08:00
committed by GitHub
2 changed files with 7 additions and 2 deletions
@@ -61,7 +61,9 @@ func (self *ModelartsPoolChangeConfigTask) OnInit(ctx context.Context, obj db.IS
self.taskFailed(ctx, pool, errors.Wrapf(err, "iMp.ChangeConfig"))
return
}
err = cloudprovider.WaitStatusWithDelay(iMp, api.MODELARTS_POOL_STATUS_RUNNING, 30*time.Second, 15*time.Second, 30*time.Minute)
// withDelay
time.Sleep(30 * time.Second)
err = cloudprovider.WaitMultiStatus(iMp, []string{api.MODELARTS_POOL_STATUS_RUNNING, api.MODELARTS_POOL_STATUS_CHANGE_CONFIG_FAILED}, 15*time.Second, 2*time.Hour)
if err != nil {
self.taskFailed(ctx, pool, errors.Wrapf(err, "WaitStatusWithDelay"))
return
@@ -69,7 +69,10 @@ func (self *ModelartsPoolCreateTask) OnInit(ctx context.Context, obj db.IStandal
self.taskFailed(ctx, pool, errors.Wrapf(err, "db.SetExternalId"))
return
}
err = cloudprovider.WaitStatusWithDelay(ipool, api.MODELARTS_POOL_STATUS_RUNNING, 30*time.Second, 15*time.Second, 30*time.Minute)
// withDelay
time.Sleep(30 * time.Second)
err = cloudprovider.WaitMultiStatus(ipool, []string{api.MODELARTS_POOL_STATUS_RUNNING, api.MODELARTS_POOL_STATUS_CREATE_FAILED}, 15*time.Second, 2*time.Hour)
if err != nil {
self.taskFailed(ctx, pool, errors.Wrapf(err, "db.WaitStatusWithDelay"))
return