Skip to content

fix: increase failure cache TTL from 15s to 5min to prevent 429 retry storm#189

Closed
YASoftwareDev wants to merge 1 commit intojarrodwatts:mainfrom
YASoftwareDev:fix/issue-188-failure-cache-ttl
Closed

fix: increase failure cache TTL from 15s to 5min to prevent 429 retry storm#189
YASoftwareDev wants to merge 1 commit intojarrodwatts:mainfrom
YASoftwareDev:fix/issue-188-failure-cache-ttl

Conversation

@YASoftwareDev
Copy link

@YASoftwareDev YASoftwareDev commented Mar 9, 2026

Bumps 'CACHE_FAILURE_TTL_MS' from 15s to 5 minutes.

With the 15s failure TTL, a single 429 response leads to an infinite cycle where the HUD retries 4 times/minute, actively preventing recovery from a transient rate-limit and keeping the 'Usage ⚠ (429)' warning permanently in the status bar.

Fixes #188, related to #187

… storm

When the usage API returns 429 (rate limited), the previous 15s failure
cache TTL caused the HUD to retry 4 times/minute indefinitely, making
recovery from a transient rate-limit impossible and keeping the
'Usage ⚠ (429)' warning permanently in the status bar.

Bumping CACHE_FAILURE_TTL_MS to 300s (5 minutes) is the standard
backoff approach for rate-limited APIs: one retry every 5 minutes
gives the server time to recover while still refreshing promptly
once the limit clears.

Fixes jarrodwatts#188
@YASoftwareDev YASoftwareDev force-pushed the fix/issue-188-failure-cache-ttl branch from b59b98b to e2d5596 Compare March 9, 2026 20:53
@jarrodwatts
Copy link
Owner

Closing as superseded by merged PR #193, which carries the 429 mitigation forward on top of current main with broader cache/backoff test coverage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Usage API: increase failure cache TTL to avoid 429 retry storm

3 participants