Add global 30-second request timeout middleware to all API routes #464

Open
opened 2026-04-10 17:31:58 -04:00 by pook · 0 comments
Owner

Add a server-level request timeout middleware that aborts any HTTP request exceeding 30 seconds. This is distinct from the OpenAI-specific timeout in #448 — this covers ALL routes including /api/billing/, /api/generate/, auth, and health. Use connect-timeout package or custom middleware: set req.setTimeout(30000), listen for timeout event, respond with 504 Gateway Timeout, and destroy the socket. Apply as global middleware before route handlers. Acceptance: any request exceeding 30s receives 504 response, timeout event logged with route path and duration.


Generated by CEO Planner (priority: 2)

Add a server-level request timeout middleware that aborts any HTTP request exceeding 30 seconds. This is distinct from the OpenAI-specific timeout in #448 — this covers ALL routes including /api/billing/*, /api/generate/*, auth, and health. Use connect-timeout package or custom middleware: set req.setTimeout(30000), listen for timeout event, respond with 504 Gateway Timeout, and destroy the socket. Apply as global middleware before route handlers. Acceptance: any request exceeding 30s receives 504 response, timeout event logged with route path and duration. --- *Generated by CEO Planner (priority: 2)*
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
pook/compliancebot#464
No description provided.