fix aischeduler bugs
Former-commit-id: bdf9f72c09b0abf0782c3ca11ef862e0379317fb
This commit is contained in:
parent
766ca71dc7
commit
997a0de27f
|
@ -55,6 +55,7 @@ func (l *ScheduleSubmitLogic) ScheduleSubmit(req *types.ScheduleReq) (resp *type
|
|||
scheResult := &types.ScheduleResult{}
|
||||
scheResult.ClusterId = r.ClusterId
|
||||
scheResult.TaskId = r.TaskId
|
||||
scheResult.Strategy = r.Strategy
|
||||
scheResult.Replica = r.Replica
|
||||
scheResult.Msg = r.Msg
|
||||
resp.Results = append(resp.Results, scheResult)
|
||||
|
|
|
@ -43,6 +43,7 @@ type AiScheduler struct {
|
|||
type AiResult struct {
|
||||
TaskId string
|
||||
ClusterId string
|
||||
Strategy string
|
||||
Replica int32
|
||||
Msg string
|
||||
}
|
||||
|
@ -154,6 +155,7 @@ func (as *AiScheduler) AssignTask(clusters []*strategy.AssignedCluster) (interfa
|
|||
result, _ := convertType(resp)
|
||||
result.Replica = c.Replicas
|
||||
result.ClusterId = c.ClusterId
|
||||
result.Strategy = as.option.StrategyName
|
||||
|
||||
ch <- result
|
||||
wg.Done()
|
||||
|
@ -167,7 +169,7 @@ func (as *AiScheduler) AssignTask(clusters []*strategy.AssignedCluster) (interfa
|
|||
errs = append(errs, e)
|
||||
}
|
||||
|
||||
if len(errs) != len(clusters) {
|
||||
if len(errs) == len(clusters) {
|
||||
return nil, errors.New("submit task failed")
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue