Merge pull request 'fix instancelist bugs' (#321) from tzwang/pcm-coordinator:master into master

This commit is contained in:
tzwang 2024-10-15 18:09:54 +08:00
commit 5789f5190b
3 changed files with 18 additions and 11 deletions

View File

@ -103,6 +103,15 @@ func (l *StartAllByDeployTaskIdLogic) startAll(list []*models.AiInferDeployInsta
return
}
}
ins.Status = "Updating"
err = l.svcCtx.Scheduler.AiStorages.UpdateInferDeployInstance(ins, true)
if err != nil {
wg.Done()
<-buf
return
}
wg.Done()
<-buf
}()

View File

@ -104,6 +104,15 @@ func (l *StopAllByDeployTaskIdLogic) stopAll(list []*models.AiInferDeployInstanc
return
}
}
ins.Status = "Updating"
err = l.svcCtx.Scheduler.AiStorages.UpdateInferDeployInstance(ins, true)
if err != nil {
wg.Done()
<-buf
return
}
wg.Done()
<-buf
}()

View File

@ -483,17 +483,6 @@ func (s *AiStorage) UpdateDeployTaskById(id int64) error {
if err != nil {
return err
}
list, err := s.GetInstanceListByDeployTaskId(id)
if err != nil {
return err
}
for _, instance := range list {
instance.Status = "Updating"
err := s.UpdateInferDeployInstance(instance, true)
if err != nil {
return err
}
}
return nil
}