fix stopall startall logic

Former-commit-id: ca3b3a57bdb722e48731f0a8e49e250277c52175
This commit is contained in:
tzwang 2024-09-09 16:36:15 +08:00
parent 6e872593c2
commit 5104009600
2 changed files with 12 additions and 2 deletions

View File

@ -82,6 +82,7 @@ func (l *StartAllByDeployTaskIdLogic) startAll(list []*models.AiInferDeployInsta
errCh <- e
wg.Done()
<-buf
return
}
if checkStopStatus(in) {
success := l.svcCtx.Scheduler.AiService.InferenceAdapterMap[strconv.FormatInt(ins.AdapterId, 10)][strconv.FormatInt(ins.ClusterId, 10)].StartInferDeployInstance(l.ctx, ins.InstanceId)
@ -100,11 +101,15 @@ func (l *StartAllByDeployTaskIdLogic) startAll(list []*models.AiInferDeployInsta
errCh <- e
wg.Done()
<-buf
return
}
}
wg.Done()
<-buf
}()
<-buf
}
wg.Wait()
close(errCh)
for e := range errCh {
errs = append(errs, e)

View File

@ -83,6 +83,7 @@ func (l *StopAllByDeployTaskIdLogic) stopAll(list []*models.AiInferDeployInstanc
errCh <- e
wg.Done()
<-buf
return
}
if checkStatus(in) {
success := l.svcCtx.Scheduler.AiService.InferenceAdapterMap[strconv.FormatInt(ins.AdapterId, 10)][strconv.FormatInt(ins.ClusterId, 10)].StopInferDeployInstance(l.ctx, ins.InstanceId)
@ -101,11 +102,15 @@ func (l *StopAllByDeployTaskIdLogic) stopAll(list []*models.AiInferDeployInstanc
errCh <- e
wg.Done()
<-buf
return
}
}
wg.Done()
<-buf
}()
<-buf
}
wg.Wait()
close(errCh)
for e := range errCh {
errs = append(errs, e)