diff --git a/api/internal/storeLink/shuguangHpc.go b/api/internal/storeLink/shuguangHpc.go index 6ad3d85e..fbd497c4 100644 --- a/api/internal/storeLink/shuguangHpc.go +++ b/api/internal/storeLink/shuguangHpc.go @@ -12,6 +12,10 @@ type ShuguangHpc struct { 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) { //TODO implement me panic("implement me") diff --git a/pkg/scheduler/scheduler.go b/pkg/scheduler/scheduler.go index aeeac794..0dc950b3 100644 --- a/pkg/scheduler/scheduler.go +++ b/pkg/scheduler/scheduler.go @@ -44,7 +44,7 @@ func NewScheduler(scheduleService scheduleService, val string, dbEngin *gorm.DB, if err != nil { 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() { @@ -214,7 +214,7 @@ func (s *scheduler) assignReplicasToResult(strategy *algo.Strategy, providerList if e == 0 { continue } - s.result[ParticipantId(providerList[i].Pid)] = Replicas(e) + s.result[ParticipantId(providerList[i].Pid)] = Replicas(int64(e)) } if len(s.result) == 0 {