Lift termination condition into for loop

Signed-off-by: Thane Thomson <connect@thanethomson.com>
This commit is contained in:
Thane Thomson
2022-04-29 14:42:45 -04:00
parent adfdfca227
commit 82dd779e93

View File

@@ -130,11 +130,7 @@ func (*BlockPool) OnStop() {}
// spawns requesters as needed
func (pool *BlockPool) makeRequestersRoutine(ctx context.Context) {
for {
if !pool.IsRunning() {
break
}
for pool.IsRunning() {
_, numPending, lenRequesters := pool.GetStatus()
switch {
case numPending >= maxPendingRequests: