Caches check results with a time-to-live.
A tool being installed does not change between requests, but it does change between deploys, so results expire rather than persisting forever. The default is one hour.
Entries live in :persistent_term, which is optimised for data written
rarely and read constantly — exactly this shape. The trade-off is that
writes are expensive and trigger a global GC scan, so nothing here writes on
a cache hit, and the number of keys is bounded by the number of declared
tools rather than by traffic.
Summary
Functions
The default time-to-live in milliseconds.
Fetches a cached value, or computes and stores it.
Drops one tool's cached result, or all of them when given :all.
Reads a cached value if it is present and still fresh.
Stores a value, returning it unchanged so it can be used inline.
Types
@type ttl() :: pos_integer() | :infinity
Milliseconds an entry stays fresh.
Functions
@spec default_ttl() :: pos_integer()
The default time-to-live in milliseconds.
Fetches a cached value, or computes and stores it.
fun runs only on a miss or an expired entry.
@spec invalidate(term() | :all) :: :ok
Drops one tool's cached result, or all of them when given :all.
Reads a cached value if it is present and still fresh.
Stores a value, returning it unchanged so it can be used inline.