MCPcopy Index your code
hub / github.com/simstudioai/sim / admissionRejectedResponse

Function admissionRejectedResponse

apps/sim/lib/core/admission/gate.ts:42–55  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

40 * Returns a 429 response for requests rejected by the admission gate.
41 */
42export function admissionRejectedResponse(): NextResponse {
43 logger.warn('Admission gate rejecting request', { inflight, maxInflight: MAX_INFLIGHT })
44 return NextResponse.json(
45 {
46 error: 'Too many requests',
47 message: 'Server is at capacity. Please retry shortly.',
48 retryAfterSeconds: 5,
49 },
50 {
51 status: 429,
52 headers: { 'Retry-After': '5' },
53 }
54 )
55}
56
57/**
58 * Returns the current gate metrics for observability.

Callers 3

route.tsFile · 0.90
route.tsFile · 0.90
route.tsFile · 0.90

Calls 1

warnMethod · 0.65

Tested by

no test coverage detected