Source: PR #4 follow-up review (should address)
Problem
cache_ttl_seconds is defined in THROTTLE_THRESHOLDS (line 74) but never read anywhere in the code. The actual TTL calculation in persist_throttle_state() (line 527) uses max(60, level_min_dwell_seconds * 4).
Since THROTTLE_THRESHOLDS is exposed to operators via the hypercart_query_guard_load_thresholds filter, having a dead key is confusing — someone will try to tune it and wonder why nothing changes.
Fix
Either:
- Remove it from the constant and document the actual TTL formula
- Wire it up — replace the hardcoded formula in
persist_throttle_state() with $thresholds['cache_ttl_seconds']
Option 1 is simpler unless there's a reason operators should control the cache TTL independently of dwell time.
Source: PR #4 follow-up review (should address)
Problem
cache_ttl_secondsis defined inTHROTTLE_THRESHOLDS(line 74) but never read anywhere in the code. The actual TTL calculation inpersist_throttle_state()(line 527) usesmax(60, level_min_dwell_seconds * 4).Since
THROTTLE_THRESHOLDSis exposed to operators via thehypercart_query_guard_load_thresholdsfilter, having a dead key is confusing — someone will try to tune it and wonder why nothing changes.Fix
Either:
persist_throttle_state()with$thresholds['cache_ttl_seconds']Option 1 is simpler unless there's a reason operators should control the cache TTL independently of dwell time.