Skip to content

Commit

Permalink
Update github/github.go
Browse files Browse the repository at this point in the history
Co-authored-by: Glenn Lewis <6598971+gmlewis@users.noreply.github.com>
  • Loading branch information
erezrokah and gmlewis committed Apr 18, 2024
1 parent aa0d4b9 commit 960ce81
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions github/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -892,8 +892,7 @@ func (c *Client) BareDo(ctx context.Context, req *http.Request) (*Response, erro

rateLimitError, ok := err.(*RateLimitError)
if ok && req.Context().Value(SleepUntilPrimaryRateLimitResetWhenRateLimited) != nil {
err := sleepUntilResetWithBuffer(req.Context(), rateLimitError.Rate.Reset.Time)
if err != nil {
if err := sleepUntilResetWithBuffer(req.Context(), rateLimitError.Rate.Reset.Time); err != nil {
return response, err
}
// retry the request once when the rate limit has reset
Expand Down

0 comments on commit 960ce81

Please sign in to comment.