fix aischeduler bugs

Former-commit-id: bdf9f72c09b0abf0782c3ca11ef862e0379317fb
This commit is contained in:
tzwang 2024-04-11 19:29:23 +08:00
parent 766ca71dc7
commit 997a0de27f
2 changed files with 4 additions and 1 deletions

View File

@ -55,6 +55,7 @@ func (l *ScheduleSubmitLogic) ScheduleSubmit(req *types.ScheduleReq) (resp *type
scheResult := &types.ScheduleResult{} scheResult := &types.ScheduleResult{}
scheResult.ClusterId = r.ClusterId scheResult.ClusterId = r.ClusterId
scheResult.TaskId = r.TaskId scheResult.TaskId = r.TaskId
scheResult.Strategy = r.Strategy
scheResult.Replica = r.Replica scheResult.Replica = r.Replica
scheResult.Msg = r.Msg scheResult.Msg = r.Msg
resp.Results = append(resp.Results, scheResult) resp.Results = append(resp.Results, scheResult)

View File

@ -43,6 +43,7 @@ type AiScheduler struct {
type AiResult struct { type AiResult struct {
TaskId string TaskId string
ClusterId string ClusterId string
Strategy string
Replica int32 Replica int32
Msg string Msg string
} }
@ -154,6 +155,7 @@ func (as *AiScheduler) AssignTask(clusters []*strategy.AssignedCluster) (interfa
result, _ := convertType(resp) result, _ := convertType(resp)
result.Replica = c.Replicas result.Replica = c.Replicas
result.ClusterId = c.ClusterId result.ClusterId = c.ClusterId
result.Strategy = as.option.StrategyName
ch <- result ch <- result
wg.Done() wg.Done()
@ -167,7 +169,7 @@ func (as *AiScheduler) AssignTask(clusters []*strategy.AssignedCluster) (interfa
errs = append(errs, e) errs = append(errs, e)
} }
if len(errs) != len(clusters) { if len(errs) == len(clusters) {
return nil, errors.New("submit task failed") return nil, errors.New("submit task failed")
} }