Refresh the usage bars every 5 minutes, not every hour
The 5h/7d bars were served from a cache with a one-hour TTL, so a bar could sit unchanged for most of a 5-hour window. The TTL is now a named config setting next to GIT_CACHE_SECS at 300s: worst case 12 requests an hour, shared across every session through /tmp/claude. The section header claimed "cached 60s" — inherited from upstream and never true here — which is what set the expectation the code did not meet. It now names the setting instead of a number that can drift. The refresh is gated on the same width-tier check as the bars, so a render that shows them is a render that refreshes them: the new tests pin that from full width down to WRAP_FLOOR, and pin that one column below it, where the bars are dropped, no request is paid for either. Those widths are given in usable columns, as in the sibling width test, so the suite does not depend on the padding in the live settings.json. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
3b4b84fb20
commit
f2dbe61276
3 changed files with 142 additions and 5 deletions
|
|
@ -11,7 +11,8 @@ cd "$(dirname "${BASH_SOURCE[0]}")" || exit 1
|
|||
|
||||
status=0
|
||||
for t in statusline.isaacaudet.payload_test.sh \
|
||||
statusline.isaacaudet.width_test.sh; do
|
||||
statusline.isaacaudet.width_test.sh \
|
||||
statusline.isaacaudet.cache_test.sh; do
|
||||
echo "== $t"
|
||||
bash "$t" || status=1
|
||||
echo
|
||||
|
|
|
|||
Loading…
Reference in a new issue