diff --git a/internal/scheduler/service/updater/deployInstance.go b/internal/scheduler/service/updater/deployInstance.go index a05df0077..ecb48329c 100644 --- a/internal/scheduler/service/updater/deployInstance.go +++ b/internal/scheduler/service/updater/deployInstance.go @@ -42,26 +42,12 @@ func UpdateDeployTaskStatus(svc *svc.ServiceContext) { ins = list[i] } } - updateDeployTaskStatus(svc, ins) -} - -func updateDeployTaskStatus(svc *svc.ServiceContext, ins *models.AiDeployInstanceTask) { - list, err := svc.Scheduler.AiStorages.GetInstanceListByDeployTaskId(ins.Id) + inslist, err := svc.Scheduler.AiStorages.GetInstanceListByDeployTaskId(ins.Id) if err != nil { return } - for i := len(list) - 1; i >= 0; i-- { - if list[i].Status == constants.Running || list[i].Status == constants.Stopped { - list = append(list[:i], list[i+1:]...) - } - } - - if len(list) == 0 { - return - } - - for _, instance := range list { + for _, instance := range inslist { go UpdateDeployInstanceStatus(svc, instance, false) } }