1
0
mirror of https://github.com/newnius/YAO-scheduler.git synced 2025-12-15 08:16:43 +00:00

update shceduler_fair, bugfix

This commit is contained in:
2019-08-01 11:17:57 +08:00
parent 83a50bb5f0
commit e178154ca0

View File

@@ -5,8 +5,7 @@ import (
"time" "time"
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
"sort" "sort"
"fmt" )
)
type SchedulerFair struct { type SchedulerFair struct {
history []*Job history []*Job
@@ -113,11 +112,10 @@ func (scheduler *SchedulerFair) Schedule(job Job) {
queue = "default" queue = "default"
} }
} }
fmt.Print(queue)
index := 0 index := 0
left := 0 left := 0
right := len(queue) - 1 right := len(scheduler.queues[queue]) - 1
for ; left <= right; { for ; left <= right; {
mid := (left + right) / 2 mid := (left + right) / 2
if scheduler.queues[queue][left].Priority < job.Priority { if scheduler.queues[queue][left].Priority < job.Priority {