From d6b628bc92249dd5ea5d8933d2075721a94f71f7 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Thu, 21 Dec 2023 16:00:15 +0800 Subject: [PATCH] Allow latest version check to take retries arg --- R/install.R | 4 ++-- R/zzz.R | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/R/install.R b/R/install.R index d5aa09768..7d92f5e95 100644 --- a/R/install.R +++ b/R/install.R @@ -398,10 +398,10 @@ github_download_url <- function(version_number) { } # get version number of latest release -latest_released_version <- function(quiet=TRUE) { +latest_released_version <- function(quiet=TRUE, ...) { dest_file <- tempfile(pattern = "releases-", fileext = ".json") download_url <- "https://api.github.com/repos/stan-dev/cmdstan/releases/latest" - release_list_downloaded <- download_with_retries(download_url, dest_file, quiet = quiet) + release_list_downloaded <- download_with_retries(download_url, dest_file, quiet = quiet, ...) if (inherits(release_list_downloaded, "try-error")) { stop("GitHub download of release list failed with error: ", attr(release_list_downloaded, "condition")$message, diff --git a/R/zzz.R b/R/zzz.R index 1da0fc2c6..0a2552582 100644 --- a/R/zzz.R +++ b/R/zzz.R @@ -14,7 +14,7 @@ startup_messages <- function() { default = identical(tolower(Sys.getenv("CMDSTANR_NO_VER_CHECK")), "true") )) if (!skip_version_check) { - latest_version <- try(suppressWarnings(latest_released_version()), silent = TRUE) + latest_version <- try(suppressWarnings(latest_released_version(retries = 0)), silent = TRUE) current_version <- try(cmdstan_version(), silent = TRUE) if (!inherits(latest_version, "try-error") && !inherits(current_version, "try-error")