MCPcopy
hub / github.com/garrytan/gstack / checkRate

Function checkRate

browse/src/token-registry.ts:406–409  ·  view source on GitHub ↗
(info: TokenInfo)

Source from the content-addressed store, hash-verified

404 * Check rate limit for a client. Returns { allowed, retryAfterMs? }.
405 */
406export function checkRate(info: TokenInfo): { allowed: boolean; retryAfterMs?: number } {
407 if (info.clientId === 'root') return { allowed: true };
408 return checkRateLimit(info.clientId, info.rateLimit);
409}
410
411/**
412 * Record that a command was executed by this token.

Callers 2

Calls 1

checkRateLimitFunction · 0.85

Tested by

no test coverage detected