Merge pull request #81 from xjrwfilecoin/calibration

modify workerRequest
This commit is contained in:
Łukasz Magiera 2020-07-27 12:15:08 +02:00 committed by GitHub
commit 57868bafa6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -122,6 +122,7 @@ type workerRequest struct {
index int // The index of the item in the heap.
indexHeap int
ret chan<- workerResponse
ctx context.Context
}
@ -250,6 +251,7 @@ func (sh *scheduler) trySched() {
task := (*sh.schedQueue)[sqi]
needRes := ResourceTable[task.taskType][sh.spt]
task.indexHeap = sqi
for wnd, windowRequest := range sh.openWindows {
worker := sh.workers[windowRequest.worker]
@ -312,7 +314,7 @@ func (sh *scheduler) trySched() {
needRes := ResourceTable[task.taskType][sh.spt]
selectedWindow := -1
for _, wnd := range acceptableWindows[sqi+scheduled] {
for _, wnd := range acceptableWindows[task.indexHeap] {
wid := sh.openWindows[wnd].worker
wr := sh.workers[wid].info.Resources