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

Function checkConnectRateLimit

browse/src/token-registry.ts:513–519  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

511const CONNECT_WINDOW_MS = 60000;
512
513export function checkConnectRateLimit(): boolean {
514 const now = Date.now();
515 connectAttempts = connectAttempts.filter(a => now - a.ts < CONNECT_WINDOW_MS);
516 if (connectAttempts.length >= CONNECT_RATE_LIMIT) return false;
517 connectAttempts.push({ ts: now });
518 return true;
519}
520
521// Test-only reset.
522export function __resetConnectRateLimit(): void {

Callers 2

makeFetchHandlerFunction · 0.90

Calls 1

pushMethod · 0.45

Tested by

no test coverage detected