调度方法修改
Former-commit-id: f19df9d4b146b88ca6d75769e17915184bb036d2
This commit is contained in:
parent
1467cc1ace
commit
feb444a53b
|
@ -12,6 +12,10 @@ type ShuguangHpc struct {
|
||||||
participant *models.StorelinkCenter
|
participant *models.StorelinkCenter
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func NewShuguangHpc(ctx context.Context, svcCtx *svc.ServiceContext, participant *models.StorelinkCenter) *ShuguangHpc {
|
||||||
|
return &ShuguangHpc{ctx: ctx, svcCtx: svcCtx, participant: participant}
|
||||||
|
}
|
||||||
|
|
||||||
func (s ShuguangHpc) UploadImage(path string) (interface{}, error) {
|
func (s ShuguangHpc) UploadImage(path string) (interface{}, error) {
|
||||||
//TODO implement me
|
//TODO implement me
|
||||||
panic("implement me")
|
panic("implement me")
|
||||||
|
|
|
@ -44,7 +44,7 @@ func NewScheduler(scheduleService scheduleService, val string, dbEngin *gorm.DB,
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, errors.New("create scheduler failed : " + err.Error())
|
return nil, errors.New("create scheduler failed : " + err.Error())
|
||||||
}
|
}
|
||||||
return &scheduler{task: task, scheduleService: scheduleService, dbEngin: dbEngin, participantRpc: participantRpc}, nil
|
return &scheduler{task: task, scheduleService: scheduleService, dbEngin: dbEngin, participantRpc: participantRpc, result: make(map[ParticipantId]Replicas, 0)}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *scheduler) MatchLabels() {
|
func (s *scheduler) MatchLabels() {
|
||||||
|
@ -214,7 +214,7 @@ func (s *scheduler) assignReplicasToResult(strategy *algo.Strategy, providerList
|
||||||
if e == 0 {
|
if e == 0 {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
s.result[ParticipantId(providerList[i].Pid)] = Replicas(e)
|
s.result[ParticipantId(providerList[i].Pid)] = Replicas(int64(e))
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(s.result) == 0 {
|
if len(s.result) == 0 {
|
||||||
|
|
Loading…
Reference in New Issue