INNER CODE UNIT · TypeScript
rejectPublicAssignment
stablyai/orca · cloud/apps/relay/src/app.ts:147
const rejectPublicAssignment = (context: Context): Response => {
context.header('Retry-After', String(config.publicAssignmentRetryAfterSeconds))
return context.json({ error: 'assignments_temporarily_unavailable' }, 503)
}
// Reconnecting hosts declare themselves and are verified against the durable
// assignment inside this bounded lane, so a placement backlog can never
// starve session recovery. Unhinted traffic never touches this lane.
const stickyRetryAfterSeconds = config.publicStickyRetryAfterSeconds ?? 2
const stickyAssignmentAdmission = new RelayPublicAssignmentAdmission({
maxConcurrent: config.publicStickyConcurrency ?? 1,
maxQueued: config.publicStickyQueueMax ?? 64,
waitMs: config.publicStickyWaitMs ?? 2_000,
minIntervalMs: stickyRetryAfterSeconds * 1_000,
onRejected: (reason) => operations.recordAssignmentRejectionReason?.('sticky', reason)
})
const rejectStickyAssignment = (context: Context): Response => {
context.header('Retry-After', String(stickyRetryAfterSeconds))
return context.json({ error: 'assignments_temporarily_unavailable' }, 503)