Skip to content

Commit fa20326

Browse files
committed
fix: #169, cli_warn printing poorly
1 parent 1d42e5b commit fa20326

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

R/cache.R

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -250,12 +250,15 @@ cache_epidata_call <- function(epidata_call, fetch_args = fetch_args_list()) {
250250
as_of_recent <- check_is_recent(epidata_call$params$as_of, 7)
251251
issues_recent <- check_is_recent(epidata_call$params$issues, 7)
252252
if (as_of_recent || issues_recent) {
253-
cli::cli_warn("using cached results with `as_of` within the past week (or the future!). This will likely result ",
254-
"in an invalid cache. Consider\n",
255-
"1. disabling the cache for this session with `disable_cache` or permanently with environmental ",
256-
"variable `EPIDATR_USE_CACHE=FALSE`\n",
257-
"2. setting `EPIDATR_CACHE_MAX_AGE_DAYS={Sys.getenv('EPIDATR_CACHE_MAX_AGE_DAYS', unset = 1)}` to e.g. `3/24` ",
258-
"(3 hours).",
253+
cli::cli_warn(
254+
c(
255+
"using cached results with `as_of` within the past week (or the future!).",
256+
"This will likely result in an invalid cache. Consider\n",
257+
"1. disabling the cache for this session with `disable_cache` or permanently with environmental ",
258+
"variable `EPIDATR_USE_CACHE=FALSE`\n",
259+
"2. setting `EPIDATR_CACHE_MAX_AGE_DAYS={Sys.getenv('EPIDATR_CACHE_MAX_AGE_DAYS', unset = 1)}`",
260+
" to e.g. `3/24` (3 hours)."
261+
),
259262
.frequency = "regularly",
260263
.frequency_id = "cache timing issues",
261264
class = "cache_recent_data"

0 commit comments

Comments
 (0)