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

feat: retries & timeouts #219

Merged
merged 3 commits into from
Oct 3, 2023
Merged

feat: retries & timeouts #219

merged 3 commits into from
Oct 3, 2023

Conversation

danielgtaylor
Copy link
Owner

This adds support to Restish for automatic retries and timeouts. See the updated docs for examples. Here is what it looks like in practice:

$ restish api.rest.sh/status/429?x-retry-in=200ms
WARN: Got 429 Too Many Requests, retrying in 200ms
WARN: Got 429 Too Many Requests, retrying in 200ms
HTTP/2.0 429 Too Many Requests
... response headers truncated ...

This updates the core request handling functionality in Restish, so it equally applies to bulk resource management and any scripts you may have with loops or pagination making many requests over a short period of time.

Also includes some minor updates to the release scripts and the frontend syntax highlighter to make the examples pretty.

@codecov
Copy link

codecov bot commented Sep 29, 2023

Codecov Report

Merging #219 (cda6260) into main (9c15903) will increase coverage by 0.30%.
The diff coverage is 91.04%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #219      +/-   ##
==========================================
+ Coverage   76.66%   76.96%   +0.30%     
==========================================
  Files          26       26              
  Lines        3583     3643      +60     
==========================================
+ Hits         2747     2804      +57     
+ Misses        636      634       -2     
- Partials      200      205       +5     
Files Coverage Δ
cli/request.go 67.41% <100.00%> (+7.14%) ⬆️
cli/flag.go 53.65% <66.66%> (+10.80%) ⬆️
cli/cli.go 70.00% <33.33%> (-0.46%) ⬇️

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9c15903...cda6260. Read the comment docs.

@danielgtaylor danielgtaylor merged commit c6debe7 into main Oct 3, 2023
6 checks passed
@danielgtaylor danielgtaylor deleted the retries branch October 3, 2023 17:20
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.

None yet

2 participants