This commit is contained in:
Łukasz Magiera 2020-07-27 13:21:36 +02:00
parent 510897a497
commit 9377cb376d
2 changed files with 6 additions and 6 deletions

View File

@ -36,8 +36,8 @@ func (q *requestQueue) Remove(i int) *workerRequest {
old := *q old := *q
n := len(old) n := len(old)
item := old[i] item := old[i]
old[i] = old[n - 1] old[i] = old[n-1]
old[n - 1] = nil old[n-1] = nil
item.index = -1 item.index = -1
*q = old[0 : n-1] *q = old[0 : n-1]
sort.Sort(q) sort.Sort(q)

View File

@ -124,8 +124,8 @@ type workerRequest struct {
index int // The index of the item in the heap. index int // The index of the item in the heap.
indexHeap int indexHeap int
ret chan<- workerResponse ret chan<- workerResponse
ctx context.Context ctx context.Context
} }
type workerResponse struct { type workerResponse struct {
@ -203,7 +203,7 @@ type SchedDiagRequestInfo struct {
} }
type SchedDiagInfo struct { type SchedDiagInfo struct {
Requests []SchedDiagRequestInfo Requests []SchedDiagRequestInfo
OpenWindows []WorkerID OpenWindows []WorkerID
} }
@ -671,7 +671,7 @@ func (sh *scheduler) Info(ctx context.Context) (interface{}, error) {
} }
select { select {
case res := <- ch: case res := <-ch:
return res, nil return res, nil
case <-ctx.Done(): case <-ctx.Done():
return nil, ctx.Err() return nil, ctx.Err()