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:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 9–12s; the
|
||||
// tail (cold provider, multiple new characters) can push 30–45s, so 60 is a
|
||||
// reasonable headroom on Hobby.
|
||||
export const maxDuration = 60;
|
||||
|
||||
export async function POST(req: Request) {
|
||||
let body: SceneRequest;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
@@ -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"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user