Merge pull request 'fix strategy bugs' (#195) from tzwang/pcm-coordinator:master into master
Former-commit-id: 16ea48f02391521a9c9cccd0d7b1f77809c358a1
This commit is contained in:
commit
22049179a8
|
@ -101,8 +101,8 @@ func (l *PageListTaskLogic) updateTaskStatus(tasklist []*types.TaskModel, ch cha
|
|||
|
||||
task := list[0]
|
||||
for i := range list {
|
||||
earliest, _ := time.Parse(constants.Layout_temp, task.UpdatedTime)
|
||||
latest, _ := time.Parse(constants.Layout_temp, list[i].UpdatedTime)
|
||||
earliest, _ := time.Parse(time.RFC3339, task.UpdatedTime)
|
||||
latest, _ := time.Parse(time.RFC3339, list[i].UpdatedTime)
|
||||
if latest.Before(earliest) {
|
||||
task = list[i]
|
||||
}
|
||||
|
|
|
@ -113,6 +113,9 @@ func (as *AiScheduler) PickOptimalStrategy() (strategy.Strategy, error) {
|
|||
case strategy.REPLICATION:
|
||||
var clusterIds []string
|
||||
for _, resource := range resources {
|
||||
if resource == nil {
|
||||
continue
|
||||
}
|
||||
clusterIds = append(clusterIds, resource.ClusterId)
|
||||
}
|
||||
strategy := strategy.NewReplicationStrategy(clusterIds, 1)
|
||||
|
|
|
@ -31,6 +31,11 @@ func (ps *DynamicResourcesStrategy) Schedule() ([]*AssignedCluster, error) {
|
|||
var assignedCluster AssignedCluster
|
||||
var results []*AssignedCluster
|
||||
for _, res := range ps.resources {
|
||||
|
||||
if res == nil {
|
||||
continue
|
||||
}
|
||||
|
||||
if opt.ResourceType == "cpu" {
|
||||
if res.CpuCoreHours <= 0 {
|
||||
cluster := &AssignedCluster{ClusterId: res.ClusterId, Replicas: ps.replicas}
|
||||
|
|
Loading…
Reference in New Issue