fix(web): remove hardcoded maxDuration so Vercel dashboard setting takes effect

Code-level `export const maxDuration = 60` and vercel.json `functions`
block were overriding the dashboard's 300s setting, causing ~100 504
timeouts per day on /api/scene and /api/start. Removing them lets each
Vercel plan use its own default (60s Hobby, 300s Pro) without breaking
self-deployers.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
yuanzonghao
2026-06-06 18:18:09 +08:00
parent 812b9a8973
commit aed05a0512
7 changed files with 1 additions and 20 deletions
-3
View File
@@ -4,9 +4,6 @@ import { NextResponse } from "next/server";
import { loadEngineConfig } from "@/lib/config";
export const runtime = "nodejs";
// The synth itself has a 15s per-call ceiling in the engine. 30s here just
// covers JSON parsing + outbound network buffer.
export const maxDuration = 30;
export async function POST(req: Request) {
let body: BeatAudioRequest;
-1
View File
@@ -4,7 +4,6 @@ import { NextResponse } from "next/server";
import { loadEngineConfig } from "@/lib/config";
export const runtime = "nodejs";
export const maxDuration = 60;
export async function POST(req: Request) {
let body: InsertBeatRequest;
-1
View File
@@ -7,7 +7,6 @@ import { NextResponse } from "next/server";
import { loadEngineConfig } from "@/lib/config";
export const runtime = "nodejs";
export const maxDuration = 60;
// Same rationale as /api/vision: the client resizes to 512px max-dim webp
// (~30-80KB base64 typical) before upload, so 3 MB is generous headroom
-5
View File
@@ -13,11 +13,6 @@ function stripKnownVoices(
}
export const runtime = "nodejs";
// Capped at 60 for Vercel Hobby (300 allowed on Pro). The scene pipeline is
// Writer + CharDesigner×N + Cinematographer + Painter — happy path 912s; the
// tail (cold provider, multiple new characters) can push 3045s, so 60 is a
// reasonable headroom on Hobby.
export const maxDuration = 60;
export async function POST(req: Request) {
let body: SceneRequest;
-1
View File
@@ -4,7 +4,6 @@ import { NextResponse } from "next/server";
import { loadEngineConfig } from "@/lib/config";
export const runtime = "nodejs";
export const maxDuration = 60;
// Matches /api/vision and /api/parse-style-image — the user's resized 512px
// webp is ~30-80 KB; this caps pathological direct-API payloads (which would
-1
View File
@@ -4,7 +4,6 @@ import { NextResponse } from "next/server";
import { loadEngineConfig } from "@/lib/config";
export const runtime = "nodejs";
export const maxDuration = 60;
// Browser annotator resizes to 768 wide → typically 200-800 KB base64.
// 3 MB caps abusive direct-API payloads (which would inflate upstream
+1 -8
View File
@@ -1,11 +1,4 @@
{
"$schema": "https://openapi.vercel.sh/vercel.json",
"framework": "nextjs",
"functions": {
"app/api/start/route.ts": { "maxDuration": 60 },
"app/api/scene/route.ts": { "maxDuration": 60 },
"app/api/vision/route.ts": { "maxDuration": 60 },
"app/api/insert-beat/route.ts": { "maxDuration": 60 },
"app/api/beat-audio/route.ts": { "maxDuration": 30 }
}
"framework": "nextjs"
}