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

Retry chunked requests on large response failures #266

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

aomerk
Copy link
Contributor

@aomerk aomerk commented Sep 26, 2023

If request fails, sends 2 new requests with chunked time ranges

@@ -56,6 +61,10 @@ func (ac *client) GetAlerts(
// iterate until there are no more alerts to retrieve
for {
response, err := fetchAlerts(ctx, ac.url, input, headers)
if errors.Is(err, ErrRetryable) && input.First > 0 {
input.First /= 2
Copy link
Contributor

Choose a reason for hiding this comment

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

will this always be an integer after dividing by 2?

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