forked from JointCloud/pcm-coordinator
fix runtask api types
This commit is contained in:
parent
db9d21bfa1
commit
0abdf06f2f
|
@ -238,7 +238,7 @@ type (
|
|||
// 启动任务(资源已就绪):/runTask
|
||||
RunTaskReq {
|
||||
TaskID int64 `json:"taskID"`
|
||||
ScheduledDatas []*DataScheduleResults `json:"scheduledDatas"`
|
||||
ScheduledDatas []*DataScheduleResults `json:"scheduledDatas,optional"`
|
||||
}
|
||||
|
||||
DataScheduleResults {
|
||||
|
|
|
@ -126,6 +126,12 @@ func (l *ScheduleRunTaskLogic) SaveResult(task *models.Task, results []*schedule
|
|||
|
||||
func updateClustersByScheduledDatas(taskId int64, clustersWithDataDistributes *ClustersWithDataDistributes, scheduledDatas []*types.DataScheduleResults) ([]*strategy.AssignedCluster, error) {
|
||||
assignedClusters := make([]*strategy.AssignedCluster, 0)
|
||||
|
||||
if len(scheduledDatas) == 0 {
|
||||
for _, cluster := range clustersWithDataDistributes.Clusters {
|
||||
assignedClusters = append(assignedClusters, cluster)
|
||||
}
|
||||
} else {
|
||||
// handle pass-in scheduledDatas
|
||||
for _, cluster := range clustersWithDataDistributes.Clusters {
|
||||
for _, data := range scheduledDatas {
|
||||
|
@ -222,6 +228,7 @@ func updateClustersByScheduledDatas(taskId int64, clustersWithDataDistributes *C
|
|||
}
|
||||
assignedClusters = append(assignedClusters, cluster)
|
||||
}
|
||||
}
|
||||
|
||||
// handle db yaml clustersWithDataDistributes
|
||||
for _, cluster := range assignedClusters {
|
||||
|
|
Loading…
Reference in New Issue