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 Jun 5, 2019
1 parent c9f523d commit 78a2de6
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 78a2de6

Please sign in to comment.