Browse Source

Merge pull request 'fix startall stopall bugs' (#305) from tzwang/pcm-coordinator:master into master

Former-commit-id: ee8207785f
pull/308/head
tzwang 1 year ago
parent
commit
5199dbf8f7
2 changed files with 12 additions and 2 deletions
  1. +6
    -1
      internal/logic/inference/startallbydeploytaskidlogic.go
  2. +6
    -1
      internal/logic/inference/stopallbydeploytaskidlogic.go

+ 6
- 1
internal/logic/inference/startallbydeploytaskidlogic.go View File

@@ -82,6 +82,7 @@ func (l *StartAllByDeployTaskIdLogic) startAll(list []*models.AiInferDeployInsta
errCh <- e errCh <- e
wg.Done() wg.Done()
<-buf <-buf
return
} }
if checkStopStatus(in) { if checkStopStatus(in) {
success := l.svcCtx.Scheduler.AiService.InferenceAdapterMap[strconv.FormatInt(ins.AdapterId, 10)][strconv.FormatInt(ins.ClusterId, 10)].StartInferDeployInstance(l.ctx, ins.InstanceId) 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 errCh <- e
wg.Done() wg.Done()
<-buf <-buf
return
} }
} }
wg.Done()
<-buf
}() }()
<-buf
} }
wg.Wait()
close(errCh)


for e := range errCh { for e := range errCh {
errs = append(errs, e) errs = append(errs, e)


+ 6
- 1
internal/logic/inference/stopallbydeploytaskidlogic.go View File

@@ -83,6 +83,7 @@ func (l *StopAllByDeployTaskIdLogic) stopAll(list []*models.AiInferDeployInstanc
errCh <- e errCh <- e
wg.Done() wg.Done()
<-buf <-buf
return
} }
if checkStatus(in) { if checkStatus(in) {
success := l.svcCtx.Scheduler.AiService.InferenceAdapterMap[strconv.FormatInt(ins.AdapterId, 10)][strconv.FormatInt(ins.ClusterId, 10)].StopInferDeployInstance(l.ctx, ins.InstanceId) 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 errCh <- e
wg.Done() wg.Done()
<-buf <-buf
return
} }
} }
wg.Done()
<-buf
}() }()
<-buf
} }
wg.Wait()
close(errCh)


for e := range errCh { for e := range errCh {
errs = append(errs, e) errs = append(errs, e)


Loading…
Cancel
Save