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 retry functionality #14

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open

Add retry functionality #14

wants to merge 8 commits into from

Conversation

Aeilert
Copy link
Collaborator

@Aeilert Aeilert commented Mar 24, 2022

Adds retry functionality

  • New function retry_request() to try and retry a GET request. Works on any URL. Only retries if the request failed due to a relevant server error (429, 500, 503, 504)
  • New function send_query() as a wrapper for build_url() and retry_request()
  • New function retry_host() to try and retry a host connection. Currently not used as part of the main API functions. We could use this as part of a diagnostic process if we want.
  • Note that send_query() uses ... for additional parameters passed to retry_request() . This option is however not exposed in get_stats() or get_aux()

* Add new functions; retry_host() and retry_request()
* Remove check_api() and check_internet() from main exported functions
* Add new function; send_query to call the API

Closes #5
Closes #8
@Aeilert Aeilert added the enhancement New feature or request label Mar 24, 2022
@Aeilert Aeilert self-assigned this Mar 24, 2022
Aeilert added 2 commits March 24, 2022 06:36
Add one additional unit test for retry_request
@Aeilert Aeilert linked an issue Mar 24, 2022 that may be closed by this pull request
Aeilert added 2 commits March 25, 2022 10:26
Change the status codes in retry_request() that triggers a GET retry.
Base automatically changed from dev to main March 30, 2022 12:43
@tonyfujs tonyfujs assigned tonyfujs and unassigned Aeilert Apr 4, 2022
@tonyfujs tonyfujs removed their request for review April 4, 2022 08:50
@shahronak47
Copy link
Contributor

devtools::check() currently returns a NOTE

checking R code for possible problems ... NOTE
  File ‘pipr/R/zzz.R’:
    .onLoad calls:
      packageStartupMessage("Info: Session based caching is enabled.")
  
  See section ‘Good practice’ in '?.onAttach'.

Probably, we want to pull the changes from main to define .onAttach separately.

@randrescastaneda
Copy link
Collaborator

Task linked: CU-2me73h0 Add retry Functionality

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
4 participants