Skip to content

Commit

Permalink
Wait next to the HTTP request
Browse files Browse the repository at this point in the history
  • Loading branch information
ericvolp12 committed Mar 21, 2024
1 parent 5b19fd4 commit ea4445d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions cmd/netsync/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -447,9 +447,6 @@ func (s *NetsyncState) worker(id int) error {
return nil
}

// Wait for rate limiter
s.limiter.Wait(ctx)

// Clone repo
cloneState, err := s.cloneRepo(ctx, repo)
if err != nil {
Expand Down Expand Up @@ -498,6 +495,8 @@ func (s *NetsyncState) cloneRepo(ctx context.Context, did string) (cloneState st
req.Header.Set(s.magicHeaderKey, s.magicHeaderVal)
}

s.limiter.Wait(ctx)

resp, err := s.client.Do(req)
if err != nil {
cloneState = "failed (client.do)"
Expand Down

0 comments on commit ea4445d

Please sign in to comment.