diff --git a/R/hit_api.R b/R/hit_api.R index 7339712..e887940 100644 --- a/R/hit_api.R +++ b/R/hit_api.R @@ -167,7 +167,11 @@ hit_national_map_api <- function(bbox, if (!is.null(body$error) && counter < 15 && (is.null(body$href) && service %in% method$href)) { - Sys.sleep(1) + backoff <- stats::runif(n = 1, min = 0, max = floor(c( + 2^counter - 1, + 30 + ))) + Sys.sleep(backoff) get_href(counter = counter + 1) } else { return(body)