From b4704cd2b22600c0f96bd76285b3ace037cabf4a Mon Sep 17 00:00:00 2001 From: Johannes Nicolai Date: Fri, 24 May 2024 14:26:26 +0200 Subject: [PATCH] feat: 60 s timeout for custom_generate endpoint * increased timeout for custom_generate to 60 s * prevents many timeouts if wait_audio is set to true on Vercel * highest possible value to work in all Vercel tiers --- src/app/api/custom_generate/route.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/app/api/custom_generate/route.ts b/src/app/api/custom_generate/route.ts index c613803..7fd4d09 100644 --- a/src/app/api/custom_generate/route.ts +++ b/src/app/api/custom_generate/route.ts @@ -2,6 +2,7 @@ import { NextResponse, NextRequest } from "next/server"; import { sunoApi } from "@/lib/SunoApi"; import { corsHeaders } from "@/lib/utils"; +export const maxDuration = 60; // allow longer timeout for wait_audio == true export const dynamic = "force-dynamic"; export async function POST(req: NextRequest) {