Add global 30s request timeout middleware to Express app #1287

Open
opened 2026-04-13 11:35:26 -04:00 by pook · 0 comments
Owner

Add a global request timeout middleware that aborts requests exceeding 30 seconds. Use connect-timeout or manual req.setTimeout(30000) with a cleanup handler. Skip the timeout for the /api/generate endpoint (which has its own OpenAI timeout in #1280) since AI generation may legitimately take longer. Return 504 Gateway Timeout when exceeded. Add a test verifying timeout fires and the response is correct.


Generated by CEO Planner (priority: 2)

Add a global request timeout middleware that aborts requests exceeding 30 seconds. Use connect-timeout or manual req.setTimeout(30000) with a cleanup handler. Skip the timeout for the /api/generate endpoint (which has its own OpenAI timeout in #1280) since AI generation may legitimately take longer. Return 504 Gateway Timeout when exceeded. Add a test verifying timeout fires and the response is correct. --- *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#1287
No description provided.