Browse Source

fix: increase generate route timeout to 10 minutes for video polling

maxDuration was 5 minutes which caused Next.js to kill the route handler
before Seedance 2.0 video generation polling could complete, resulting
in a network error on the client despite successful generation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
handoff-20260429-1057
shrimbly 3 months ago
parent
commit
8e72dcb997
  1. 2
      src/app/api/generate/route.ts

2
src/app/api/generate/route.ts

@ -22,7 +22,7 @@ import { generateWithWaveSpeed } from "./providers/wavespeed";
// Re-export for backward compatibility (test file imports from route) // Re-export for backward compatibility (test file imports from route)
export const clearFalInputMappingCache = _clearFalInputMappingCache; export const clearFalInputMappingCache = _clearFalInputMappingCache;
export const maxDuration = 300; // 5 minute timeout (Vercel hobby plan limit) export const maxDuration = 600; // 10 minute timeout for video generation polling
export const dynamic = 'force-dynamic'; // Ensure this route is always dynamic export const dynamic = 'force-dynamic'; // Ensure this route is always dynamic

Loading…
Cancel
Save