-
Notifications
You must be signed in to change notification settings - Fork 502
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 on Retry-After response header #2540
Conversation
Codecov Report
@@ Coverage Diff @@
## main #2540 +/- ##
==========================================
+ Coverage 81.10% 81.11% +0.01%
==========================================
Files 144 144
Lines 2535 2537 +2
Branches 41 47 +6
==========================================
+ Hits 2056 2058 +2
Misses 479 479
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybeRetried.getOrElse(Resource.pure(response)) | ||
} | ||
|
||
run(5) // arbitrary limit to avoid unexpected cloud provider costs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this be made configurable?
@exoego, thanks for the review. Test added. |
Bump. |
@exoego Looks like the only remaining coverage gap is in the dependency injection stuff that wasn't covered previously. Can this be merged? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
@fthomas are you interested in this change, or should I close the PR? |
Sorry for long delay. Thanks for your effort. |
Partially addresses #2355 by implementing Retry-After support.
seconds, not dates
I'm only handling response headers of the form
Reply-After: 60
seconds since that's what github actually returns. Non-numeric/date-based values like the one in the RFC will be ignored: