Skip to content

Commit f58566f

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

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

R/buildtools.R

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,8 +237,14 @@ base64_gunzip <- function(b64){
237237
}
238238

239239
url_exists <- function(url){
240-
req <- curl::curl_fetch_memory(url)
241-
return(req$status < 400)
240+
for(i in 1:3){
241+
try({
242+
req <- curl::curl_fetch_memory(url)
243+
return(req$status < 400)
244+
})
245+
Sys.sleep(10)
246+
}
247+
stop("Failed to connect to: ", url)
242248
}
243249

244250
sysdep_shortname <- function(x){

0 commit comments

Comments
 (0)