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 a function that is retrying a request if server sending some error #4

Open
defuneste opened this issue Jul 9, 2024 · 1 comment

Comments

@defuneste
Copy link
Member

No description provided.

@defuneste
Copy link
Member Author

This is one is specifically needed here

cori.data.fcc/R/dl_nbm.R

Lines 44 to 58 in cfa68e8

for (i in seq_len(nrow(one_release_to_dl))) {
dest_file <- paste0(path_to_dl, "/",
one_release_to_dl$file_name[i],
".zip")
if (file.exists(dest_file)) {
print(paste(dest_file, "already downloaded, skipping it"))
next
}
try(utils::download.file(url = paste0(base_url, one_release_to_dl$id[i], "/1"),
destfile = dest_file,
headers = c("User-Agent" = user_agent), ...))
}

where it should check the result of an upload and retry before looping (apply should be used also)

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