Skip to main content

Module cache

Module cache 

Source
Expand description

~/.cache/<bin>/update-check.json: what the last check found, and when.

Structs§

Cache

Constants§

SCHEMA
TTL_SECS
Re-check at most once per this many seconds.

Functions§

claim
The record the startup check writes before spawning its refresh: stamped now, so no other run starts one, and keeping this binary’s known update.
load
needs_refresh
True when there is no usable cache, it is older than the TTL, it is about another binary, or its timestamp is in the future (clock moved back).
notice
The one stderr line, when the cache says a newer build exists for THIS binary.
path
$XDG_CACHE_HOME/<bin>/update-check.json, else $HOME/.cache/....
store
Write via a temp file and rename, so a reader never sees half a file.