Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement rate limit handling for the enterprise API client #12

Merged
merged 5 commits into from
Feb 23, 2024

Conversation

loganintech
Copy link
Contributor

No description provided.

@@ -256,5 +278,14 @@ func (c *Client) doRequest(ctx context.Context, url string, res interface{}, met
return err
}

if !res.IsOk() && strings.Contains(res.ErrorText(), "ratelimited") {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we check for http status code 429 instead of looking in the error text?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm game

@loganintech loganintech merged commit 19c69c8 into main Feb 23, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants