From f58566f99e1af068fa6151ffdf30f120ae906ff1 Mon Sep 17 00:00:00 2001 From: Jeroen Ooms Date: Mon, 28 Oct 2024 15:58:54 +0100 Subject: [PATCH] Make url_exists more robust --- R/buildtools.R | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/R/buildtools.R b/R/buildtools.R index bbd69e3..faded95 100644 --- a/R/buildtools.R +++ b/R/buildtools.R @@ -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){