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?
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With