View Source Plausible.Cache.Warmer (Plausible v0.0.1)
A periodic cache warmer.
Child specification options available:
cache_impl
- module expected to implementPlausible.Cache
behaviourinterval
- the number of milliseconds for each warm-up cyclecache_name
- defaults to cache_impl.name() but can be overridden for testingforce_start?
- enforcess process startup for testing, even if it's barred byPlausible.Cache.enabled?
. This is useful for avoiding issues with DB ownership and async tests.warmer_fn
- by convention, either:refresh_all
or:refresh_updated_recently
, both are automatically provided bycache_impl
module. Technically any exported or captured function will work, if need be.
See tests for more comprehensive examples.
Summary
Functions
@spec child_spec(Keyword.t()) :: Supervisor.child_spec() | :ignore