Skip to content

Commit da41c11

Browse files
committed
Make url_exists more robust
1 parent 2039cc0 commit da41c11

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

R/buildtools.R

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,9 +236,16 @@ base64_gunzip <- function(b64){
236236
rawToChar(memDecompress(bin, 'gzip'))
237237
}
238238

239+
# Account for some random GHA network failures
239240
url_exists <- function(url){
240-
req <- curl::curl_fetch_memory(url)
241-
return(req$status < 400)
241+
for(i in 1:3){
242+
try({
243+
req <- curl::curl_fetch_memory(url)
244+
return(req$status < 400)
245+
})
246+
Sys.sleep(3)
247+
}
248+
stop("Failed to connect to: ", url)
242249
}
243250

244251
sysdep_shortname <- function(x){

0 commit comments

Comments
 (0)