Reputation: 23142
I have a Server Action in NextJS14 hosted on Vercel. In the Vercel logs I can see the function is timing out:
Execution Duration / Limit. 15.01s / 15s (timed out)
I'm calling the OpenAI API which can be slow. How do I increase the time limit?
Upvotes: 3
Views: 1106
Reputation: 31
You must apply a new max duration inside your top level page.tsx:
export const maxDuration = 90;
export async function Page(){ }
Inside route-segment in next-js docs you can find more information about it.
Upvotes: 3