Skip to content

Commit

Permalink
Make url_exists more robust
Browse files Browse the repository at this point in the history
  • Loading branch information
jeroen committed Oct 28, 2024
1 parent 2039cc0 commit f58566f
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions R/buildtools.R
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,14 @@ base64_gunzip <- function(b64){
}

url_exists <- function(url){
req <- curl::curl_fetch_memory(url)
return(req$status < 400)
for(i in 1:3){
try({
req <- curl::curl_fetch_memory(url)
return(req$status < 400)
})
Sys.sleep(10)
}
stop("Failed to connect to: ", url)
}

sysdep_shortname <- function(x){
Expand Down

0 comments on commit f58566f

Please sign in to comment.