Skip to content

Commit

Permalink
cleanup: as tested and discussed
Browse files Browse the repository at this point in the history
Signed-off-by: Sandor Szücs <[email protected]>
  • Loading branch information
szuecs committed Oct 19, 2023
1 parent f8abdfe commit f895baa
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions scheduler/scheduler.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,18 +193,6 @@ func (fq *fifoQueue) wait(ctx context.Context) (func(), error) {
// does not exist yet in Go stdlib as of Go1.18.4
return nil, err
}
} else {
// semaphore will not fail on Acquire when context timed out, nor when it's canceled.
// see also: https://github.com/golang/go/issues/63615
// The behavior can change as in the proposed change, so the code path on error would apply.
// If the proposed change was merge this code path below can likely be cleaned up.
select {
case <-c.Done():
// We timed out in Acquire, so it never increased semaphore by one
cnt.Add(-1)
return nil, ErrQueueTimeout
default:
}
}

return func() {
Expand Down

0 comments on commit f895baa

Please sign in to comment.