From 1ec9632d4b7f75da63ce3e73e038bfb8e385390f Mon Sep 17 00:00:00 2001 From: Richard R Date: Wed, 27 May 2026 01:41:29 -0600 Subject: [PATCH] feat(api): set maxDuration for document parsed events route Define maxDuration as 300 seconds for the parsed events API route to explicitly control execution timeouts during long-running PDF layout processing. This ensures more predictable serverless behavior for streaming operations. --- src/app/api/documents/[id]/parsed/events/route.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/app/api/documents/[id]/parsed/events/route.ts b/src/app/api/documents/[id]/parsed/events/route.ts index 5859d4a..28bc7b8 100644 --- a/src/app/api/documents/[id]/parsed/events/route.ts +++ b/src/app/api/documents/[id]/parsed/events/route.ts @@ -17,6 +17,7 @@ import type { PdfLayoutJobResult, WorkerOperationEvent, WorkerOperationState } f export const dynamic = 'force-dynamic'; export const runtime = 'nodejs'; +export const maxDuration = 300; const SSE_KEEPALIVE_MS = 15_000; const SSE_RESYNC_INTERVAL_MS = 30_000;