Skip to contents

Staleness is determined by the number of days from 2am on the current day in the current time-zone. A item cached for only one day becomes stale at 2am the day after it is cached. The time is configurable and option(cache.time_day_starts = 0) would be midnight. Automated analysis using caches and updated data should ensure that analysis does not cross this time point otherwise it may end up using old data.

Usage

cache_delete_stale(
  .cache = getOption("cache.dir", default = rappdirs::user_cache_dir("ggrrr")),
  .prefix = ".*",
  .stale = getOption("cache.stale", default = Inf)
)

Arguments

.cache

the location of the cache as a directory. May get its value from options("cache.dir") or the default value of rappdirs::user_cache_dir("ggrrr")

.prefix

a name of the operation so that you can namespace the cached files and do selective clean up operations on them

.stale

the length of time in days to keep cached data before considering it as stale.

Value

nothing. called for side effects.