-
Notifications
You must be signed in to change notification settings - Fork 45
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
added retry logic for all HTTP requests #216
Conversation
Thanks @jameslamb for the useful prompt to ensure that EDIT: Actually, |
sure, not a problem. Could you explain why |
The The tests are mocked, so they do not execute real http requests. A "recording" has to be made of a successful response, and then the test uses |
I disagree that I disagree that HTTP has "...only two known verbs, Mocking
req <- request_build(verb, hu$url, body_config(body, match.arg(encode)), config, ...)
req <- request_build("GET", hu$url, as.request(config), ...) |
What would you like to do then? The PR as submitted was inappropriate because the tests can not just be changed like that, so it has to be fixed. Of course there are more http verbs, but there are only two fetch verbs. And any wrapper in R that serves to change the way external library calls are handled and processed can of course be argued to be "thin" - the only layer in which I'm happy to work with you on this, but less disagreement would be helpful, as would thinking a bit more about the underlying code structure. |
I'll close this pull request. Have a good week. |
no worries - please feel free to contribute any other way you might like. Thanks for the interest and input regardless 😄 |
Thanks for this great package!
In this PR, I'd like to propose swapping out calls to
httr::POST()
,httr::GET()
, 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.I'm working on chircollab/chircollab20#1 as part of Chicago R Collab, an R 'unconference' in Chicago.