Skip to content

Commit 19ac3bf

Browse files
committed
style: use glue for line-wrapping in cache warnings
1 parent 2b48321 commit 19ac3bf

File tree

1 file changed

+9
-13
lines changed

1 file changed

+9
-13
lines changed

R/cache.R

+9-13
Original file line numberDiff line numberDiff line change
@@ -252,23 +252,20 @@ cache_epidata_call <- function(epidata_call, fetch_args = fetch_args_list()) {
252252
if (as_of_recent || issues_recent) {
253253
cli::cli_warn(
254254
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-
),
262-
.frequency = "regularly",
263-
.frequency_id = "cache timing issues",
264-
class = "cache_recent_data"
255+
"Using cached results with `as_of` within the past week (or the future!).
256+
This will likely result in an invalid cache. Consider",
257+
"i" = "disabling the cache for this session with `disable_cache` or
258+
permanently with environmental variable `EPIDATR_USE_CACHE=FALSE`",
259+
"i" = "setting `EPIDATR_CACHE_MAX_AGE_DAYS={Sys.getenv('EPIDATR_CACHE_MAX_AGE_DAYS
260+
', unset = 1)}` to e.g. `3/24` (3 hours)."
261+
)
265262
)
266263
}
267264
if (!is.key_missing(cached)) {
268265
cli::cli_warn(
269266
c(
270-
"loading from the cache at {cache_environ$epidatr_cache$info()$dir}; ",
271-
"see {cache_environ$epidatr_cache$info()$logfile} for more details."
267+
"Loading from the cache at {cache_environ$epidatr_cache$info()$dir};
268+
see {cache_environ$epidatr_cache$info()$logfile} for more details."
272269
),
273270
.frequency = "regularly",
274271
.frequency_id = "using the cache",
@@ -277,7 +274,6 @@ cache_epidata_call <- function(epidata_call, fetch_args = fetch_args_list()) {
277274
return(cached[[1]])
278275
}
279276
}
280-
'which was saved on {format(cached[[2]],"%A %B %d, %Y")}, which took {round(cached[[3]][[3]], digits=5)} seconds.'
281277
# need to actually get the data, since its either not in the cache or we're not caching
282278
runtime <- system.time(if (epidata_call$only_supports_classic) {
283279
fetched <- fetch_classic(epidata_call, fetch_args)

0 commit comments

Comments
 (0)