MCPcopy Index your code
hub / github.com/BlockRunAI/ClawRouter / isRateLimited

Function isRateLimited

src/proxy.ts:497–507  ·  view source on GitHub ↗

* Check if a model is currently rate-limited (in cooldown period).

(modelId: string)

Source from the content-addressed store, hash-verified

495 * Check if a model is currently rate-limited (in cooldown period).
496 */
497function isRateLimited(modelId: string): boolean {
498 const hitTime = rateLimitedModels.get(modelId);
499 if (!hitTime) return false;
500
501 const elapsed = Date.now() - hitTime;
502 if (elapsed >= RATE_LIMIT_COOLDOWN_MS) {
503 rateLimitedModels.delete(modelId);
504 return false;
505 }
506 return true;
507}
508
509/**
510 * Mark a model as rate-limited.

Callers 1

prioritizeNonRateLimitedFunction · 0.85

Calls 1

getMethod · 0.80

Tested by

no test coverage detected