style(usage): prettier line-wrap for claude-usage 429 backoff
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -206,7 +206,10 @@ async function fetchUsageForToken(
|
||||
* apply to *failures* too — without it an empty cache means every dashboard
|
||||
* refresh hits the API, which itself sustains the very 429s we then report.
|
||||
*/
|
||||
const recordAttempt = (errorStatus?: number, cooldownUntil?: number): void => {
|
||||
const recordAttempt = (
|
||||
errorStatus?: number,
|
||||
cooldownUntil?: number,
|
||||
): void => {
|
||||
const now = Date.now();
|
||||
const entry: UsageCacheEntry = usageDiskCache[writeKey] ?? {
|
||||
usage: {},
|
||||
@@ -308,7 +311,8 @@ async function fetchUsageForToken(
|
||||
tokenKey: legacyTokenCacheKey(token),
|
||||
cacheKey: writeKey,
|
||||
staleMinutes: Math.round(staleMs / 60_000),
|
||||
retryAfterSec: retryAfterMs != null ? Math.round(retryAfterMs / 1000) : null,
|
||||
retryAfterSec:
|
||||
retryAfterMs != null ? Math.round(retryAfterMs / 1000) : null,
|
||||
cooldownSec: Math.round(cooldownMs / 1000),
|
||||
},
|
||||
'Claude usage API: rate limited (429)',
|
||||
|
||||
Reference in New Issue
Block a user