modify for unsafe
This commit is contained in:
parent
e5873d5dea
commit
60e950015c
10
extern/sector-storage/sched.go
vendored
10
extern/sector-storage/sched.go
vendored
@ -417,6 +417,7 @@ func (sh *scheduler) trySched() {
|
|||||||
|
|
||||||
// Step 2
|
// Step 2
|
||||||
scheduled := 0
|
scheduled := 0
|
||||||
|
rmQueue := make([]int, 0, sh.schedQueue.Len())
|
||||||
|
|
||||||
for sqi := 0; sqi < sh.schedQueue.Len(); sqi++ {
|
for sqi := 0; sqi < sh.schedQueue.Len(); sqi++ {
|
||||||
task := (*sh.schedQueue)[sqi]
|
task := (*sh.schedQueue)[sqi]
|
||||||
@ -453,11 +454,16 @@ func (sh *scheduler) trySched() {
|
|||||||
|
|
||||||
windows[selectedWindow].todo = append(windows[selectedWindow].todo, task)
|
windows[selectedWindow].todo = append(windows[selectedWindow].todo, task)
|
||||||
|
|
||||||
sh.schedQueue.Remove(sqi)
|
rmQueue = append(rmQueue, sqi)
|
||||||
sqi--
|
|
||||||
scheduled++
|
scheduled++
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if len(rmQueue) > 0 {
|
||||||
|
for i := len(rmQueue) - 1; i >= 0; i++ {
|
||||||
|
sh.schedQueue.Remove(rmQueue[i])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Step 3
|
// Step 3
|
||||||
|
|
||||||
if scheduled == 0 {
|
if scheduled == 0 {
|
||||||
|
Loading…
Reference in New Issue
Block a user