sched: More fixes
This commit is contained in:
parent
5c5fe09990
commit
7f115954fd
4
sched.go
4
sched.go
@ -260,7 +260,7 @@ func (sh *scheduler) trySched() {
|
|||||||
rand.Shuffle(len(acceptableWindows[sqi]), func(i, j int) {
|
rand.Shuffle(len(acceptableWindows[sqi]), func(i, j int) {
|
||||||
acceptableWindows[sqi][i], acceptableWindows[sqi][j] = acceptableWindows[sqi][j], acceptableWindows[sqi][i]
|
acceptableWindows[sqi][i], acceptableWindows[sqi][j] = acceptableWindows[sqi][j], acceptableWindows[sqi][i]
|
||||||
})
|
})
|
||||||
sort.SliceStable(acceptableWindows, func(i, j int) bool {
|
sort.SliceStable(acceptableWindows[sqi], func(i, j int) bool {
|
||||||
wii := sh.openWindows[acceptableWindows[sqi][i]].worker
|
wii := sh.openWindows[acceptableWindows[sqi][i]].worker
|
||||||
wji := sh.openWindows[acceptableWindows[sqi][j]].worker
|
wji := sh.openWindows[acceptableWindows[sqi][j]].worker
|
||||||
|
|
||||||
@ -344,7 +344,7 @@ func (sh *scheduler) trySched() {
|
|||||||
// Rewrite sh.openWindows array, removing scheduled windows
|
// Rewrite sh.openWindows array, removing scheduled windows
|
||||||
newOpenWindows := make([]*schedWindowRequest, 0, len(sh.openWindows)-len(scheduledWindows))
|
newOpenWindows := make([]*schedWindowRequest, 0, len(sh.openWindows)-len(scheduledWindows))
|
||||||
for wnd, window := range sh.openWindows {
|
for wnd, window := range sh.openWindows {
|
||||||
if _, scheduled := scheduledWindows[wnd]; !scheduled {
|
if _, scheduled := scheduledWindows[wnd]; scheduled {
|
||||||
// keep unscheduled windows open
|
// keep unscheduled windows open
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user