Skip to content

Commit

Permalink
repeat download without counting to max number of retries
Browse files Browse the repository at this point in the history
  • Loading branch information
rfhb committed Aug 28, 2024
1 parent 30d3b7d commit 84c3d48
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions R/util_functions.R
Original file line number Diff line number Diff line change
Expand Up @@ -872,11 +872,16 @@ ctrMultiDownload <- function(
stop("Download failed; last error: ", class(downloadValue), call. = FALSE)
}

numI <- numI + 1L
toDo <- is.na(downloadValue[["success"]]) |
toDoThis <- is.na(downloadValue[["success"]]) |
!downloadValue[["success"]] |
!(downloadValue[["status_code"]] %in% c(200L, 206L, 416L))

# only count towards repeat attempts if
# the set of repeated urls is unchanged
if (identical(toDo, toDoThis)) numI <- numI + 1L

toDo <- toDoThis

}

if (any(toDo)) {
Expand Down

0 comments on commit 84c3d48

Please sign in to comment.