1
0
mirror of https://github.com/newnius/YAO-scheduler.git synced 2025-12-13 07:46:43 +00:00

update shceduler_fair

This commit is contained in:
2019-08-01 14:07:51 +08:00
parent c1c6a8eafb
commit bac49853db

View File

@@ -340,10 +340,15 @@ func (scheduler *SchedulerFair) UpdateNextQueue() {
} }
} }
for k, v := range scheduler.resourceAllocations { for k, t := range scheduler.queues {
if t, ok := scheduler.queues[k]; !ok || len(t) == 0 { if len(t) == 0 {
continue continue
} }
if _, ok := scheduler.resourceAllocations[k]; !ok {
scheduler.resourceAllocations[k] = &ResourceCount{}
}
v := scheduler.resourceAllocations[k]
tmp := 0.0 tmp := 0.0
tmp += float64(v.CPU) / CPU tmp += float64(v.CPU) / CPU
tmp += float64(v.Memory) / Memory tmp += float64(v.Memory) / Memory