-
Notifications
You must be signed in to change notification settings - Fork 52
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
replaced single-shot HTTP requests with RETRY() #113
Conversation
Codecov Report
@@ Coverage Diff @@
## master #113 +/- ##
==========================================
- Coverage 51.54% 45.37% -6.17%
==========================================
Files 12 12
Lines 454 454
==========================================
- Hits 234 206 -28
- Misses 220 248 +28
Continue to review full report at Codecov.
|
I've rebased this to pick up the changes merged into this project in the time since this pull request was opened. |
I just merged in the latest changes from Are you open to this pull request? If not, I'd be happy to close it. |
The tests are failing, is this a false positive or a limitation of |
@krlmlr Seems like because there is no GH token in the PR. |
Good catch, will try locally. |
Can't rerun, this seems to be a special token. Do the tests work for you locally? |
Yes. |
I like the approach. Of course we could do better by reviewing the headers. Merging this will ease the pain of failing GHA tests due to rate limits. |
Maybe we should use |
This feels like a big change for me, and I think it would be better to make it optional and opt-in. |
I'll test-drive it so that we can gain more experience here. Opt-in won't fix the problems right away, we'd need to change all packages that use it to opt in. |
What are the problems that this would fix right away? |
I'm hoping that the functions in remotes that access the GitHub API will wait when the rate limit is exceeded, when they would otherwise fail. |
remotes does not use gh for anything. |
This PR has been open for 20+ months, and hasn't received a new comment in over a year. I'm going to close it and leave it to maintainers to make this change separately if you want. |
Thanks for for this awesome project!
In this PR, I'd like to propose swapping out calls to
httr::POST()
etc. withhttr::RETRY()
. This will make the package more resilient to transient problems like brief network outages or periods where the service(s) it hits are overwhelmed. In my experience, using retry logic almost always improves the user experience with HTTP clients.httr::RETRY()
is awesome...it already implements exponential backoff and if you want you can customize things like how many retries it attempts and how long it's willing to wait between retries.I'm working on chircollab/chircollab20#1 as part of Chicago R Collab, an R 'unconference' in Chicago.
Thanks for your time and consideration.