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

Avoid reaching rate limit #69

Closed
maurolepore opened this issue Nov 12, 2018 · 0 comments
Closed

Avoid reaching rate limit #69

maurolepore opened this issue Nov 12, 2018 · 0 comments

Comments

@maurolepore
Copy link
Contributor

maurolepore commented Nov 12, 2018

Provide code to install each package independently with some delay. See how to do that here: https://adv-r.hadley.nz/function-operators.html. The main idea is this:

delay_by <- function(f, amount) {
  force(f)
  force(amount)

  function(...) {
    Sys.sleep(amount)
    f(...)
  }
}

delay_by(runif, 0.5)(10)

sufix <- c(
  "abundance", "base", "ctfs", "data", "demography", "habitat", "map", "tool"
)
forestgeo_package <- paste0("forestgeo/", paste0("fgeo/", sufix))
walk(
  forestgeo_package, 
  delay_by(devtools::install_github, 1), 
  upgrade = "never"
)

I tried this but the rate limit is still reached. Maybe it's not a rate but a total size.

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

No branches or pull requests

1 participant