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

Add support for retrying failed requests. #1405

Merged
merged 1 commit into from
Aug 18, 2023
Merged

Conversation

andrewsomething
Copy link
Member

This enables support for retrying failed requests. A few things to note:

  • I've chosen to expose the http-retry-max flag to users to give them insight into the new default behavior. I've marked the http-retry-wait-max and http-retry-wait-min flags as hidden as the defaults should be fine for most users, but it still allows for configuration if needed.
  • For the wait settings, I've used an int rather than a float64 as I feel that it is friendlier on the command line.
  • I've used the http prefix on these so that the environment variables end up consistent with the same settings ion Terraform, e.g. DIGITALOCEAN_HTTP_RETRY_MAX.
  • I've bypassed retries for the doctl account ratelimit command. The purpose of the command is to return the rate-limit headers regardless of response status. So retrying here just hides the current status and delays returning a response for no real gain.

Copy link
Member

@bentranter bentranter left a comment

Choose a reason for hiding this comment

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

LGTM!

@andrewsomething andrewsomething merged commit 5617fc5 into main Aug 18, 2023
6 checks passed
@andrewsomething andrewsomething deleted the asb/retries branch August 18, 2023 18:55
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