Skip to content

Commit

Permalink
Handle 429 with retry
Browse files Browse the repository at this point in the history
  • Loading branch information
meyskens committed Jul 13, 2024
1 parent 2d768b4 commit 372a8c7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions apiserver/pkg/ris/irail/ratelimit.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ func (c *RLHTTPClient) Do(req *http.Request) (*http.Response, error) {
if err != nil {
return nil, err
}
if resp.StatusCode == http.StatusTooManyRequests {
time.Sleep(1 * time.Second)
return c.Do(req)
}
return resp, nil
}

Expand Down

0 comments on commit 372a8c7

Please sign in to comment.