Skip to content

Commit

Permalink
query(nit): reliably fill rateLimit chan
Browse files Browse the repository at this point in the history
  • Loading branch information
Stebalien committed May 3, 2019
1 parent 317a78e commit f7005bd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion query.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ func (r *dhtQueryRunner) run(ctx context.Context, peers []peer.ID) ([]peer.ID, e

func (r *dhtQueryRunner) recurse(ctx context.Context, peers []peer.ID) error {
// setup concurrency rate limiting
for i := 0; i < r.query.concurrency; i++ {
for len(r.rateLimit) < cap(r.rateLimit) {
r.rateLimit <- struct{}{}
}

Expand Down

0 comments on commit f7005bd

Please sign in to comment.