Skip to content

Commit

Permalink
update batch downloads - unstable api gives test routine grief
Browse files Browse the repository at this point in the history
  • Loading branch information
khufkens committed Feb 23, 2024
1 parent 64fce5c commit 2f7f192
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions R/wf_request_batch.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
#' to the service. Most ECMWF services are limited to 20 concurrent requests
#' (default = 2).
#' @param total_timeout overall timeout limit for all the requests in seconds.
#' @param retry polling frequency of submitted request for downloading (default =
#' \code{30} seconds).
#' @importFrom R6 R6Class
#'
#' @rdname wf_request
Expand All @@ -13,6 +15,7 @@ wf_request_batch <- function(
user,
path = tempdir(),
time_out = 3600,
retry = 5,
total_timeout = length(request_list)*time_out/workers
) {

Expand Down Expand Up @@ -53,6 +56,7 @@ wf_request_batch <- function(
queue[[1]],
user = user[1],
time_out = time_out[1],
retry = retry,
path = path[1],
transfer = FALSE
)
Expand Down
1 change: 1 addition & 0 deletions man/wf_request.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion tests/testthat/test_cds.R
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ test_that("batch request tests", {
skip_on_cran()
skip_if(login_check)

years <- c(2017,2018)
years <- c(2017,2017)
requests <- lapply(years, function(y) {
list(
"dataset_short_name" = "reanalysis-era5-pressure-levels",
Expand All @@ -281,6 +281,7 @@ test_that("batch request tests", {

expect_output(wf_request_batch(
requests,
retry = 5,
user = "2088")
)

Expand Down

0 comments on commit 2f7f192

Please sign in to comment.