Skip to content

Commit 52f2b6b

Browse files
committed
feat: add warning to pub_covidcast_meta when cache is enabled
1 parent 9596863 commit 52f2b6b

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

R/endpoints.R

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -893,6 +893,16 @@ pub_covid_hosp_state_timeseries <- function(
893893
#' @keywords endpoint
894894
#' @export
895895
pub_covidcast_meta <- function(fetch_args = fetch_args_list()) {
896+
if (!is.null(cache_environ$use_cache) && cache_environ$use_cache && !fetch_args$ignore_cache) {
897+
cli::cli_warn(
898+
"epidatr cache is enabled, but it is unlikely you want to use it with the `pub_covidcast_meta` endpoint.
899+
use `fetch_args(ignore_cache = TRUE)` to disable the cache for this call.",
900+
class = "epidatr__pub_covidcast_meta__ignore_cache",
901+
.frequency = "once",
902+
.frequency_id = "covidcast_meta_cache"
903+
)
904+
}
905+
896906
create_epidata_call(
897907
"covidcast_meta/",
898908
list(),

0 commit comments

Comments
 (0)