From 1d2aa99a269c236613ff5115ff5e93738385f152 Mon Sep 17 00:00:00 2001 From: Fonti Kar Date: Thu, 25 Jul 2024 13:28:26 +1000 Subject: [PATCH 1/2] Increased time out --- R/global.R | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/R/global.R b/R/global.R index dcff4b0..f858583 100644 --- a/R/global.R +++ b/R/global.R @@ -203,7 +203,7 @@ check_and_download_update <- function() { message("No internet connection or data source down, try again later") return(NULL) } - response <- httr::GET(url) + response <- httr::GET(url, httr::timeout(200)) release_data <- jsonlite::fromJSON(httr::content(response, "text")) @@ -219,6 +219,13 @@ check_and_download_update <- function() { cat("New version found:", latest_version, "\n") # Download binary files + + # Get original timeout option + original_timeout <- getOption("timeout") + + # Increase timeout + options(timeout = 300) + for (i in 1:nrow(release_data$assets)) { asset_name <- release_data$assets[i, "name"] binary_url <- release_data$assets[i, "browser_download_url"] @@ -230,6 +237,10 @@ check_and_download_update <- function() { mode = "wb" ) } + + # Burn down + options(timeout = original_timeout) + writeLines(latest_version, file.path(infinity_file_path, "infinitylistversion.txt")) #creating a bug elsewhere cat("Update complete.\n") From 39d2fa3b94aa8ae751079655b3ed501693970ff3 Mon Sep 17 00:00:00 2001 From: Fonti Kar Date: Thu, 25 Jul 2024 13:31:59 +1000 Subject: [PATCH 2/2] Added ignore to Rbuildignore --- .Rbuildignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.Rbuildignore b/.Rbuildignore index f01e415..da446b9 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -11,3 +11,4 @@ ignore/ +