Documentation
¶
Overview ¶
Package redis builds the cache client.
The cache is strictly optional. Redis runs with no persistence and an LRU eviction policy, so any key may vanish at any moment; nothing correctness-critical may be stored here. Every call site must treat a Redis error as a cache miss and fall through to Postgres, and readiness reports a Redis outage as degraded rather than unready — failing readiness would take a working site out of rotation over a cache problem.
Index ¶
Constants ¶
const PingTimeout = 750 * time.Millisecond
PingTimeout is the budget for a readiness probe's cache check.
Generous, and deliberately not the number that decides a stall: ReadTimeout caps every command under it, so a Redis that accepts and never answers is reported degraded in REDIS_READ_TIMEOUT rather than in this. What this bounds is the rest — acquiring a connection, dialling one, retrying — on a probe that must answer whatever the cache is doing.
Variables ¶
This section is empty.