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 da41c11
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions R/buildtools.R
Original file line number Diff line number Diff line change
Expand Up @@ -236,9 +236,16 @@ base64_gunzip <- function(b64){
rawToChar(memDecompress(bin, 'gzip'))
}

# Account for some random GHA network failures
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(3)
}
stop("Failed to connect to: ", url)
}

sysdep_shortname <- function(x){
Expand Down

0 comments on commit da41c11

Please sign in to comment.