From 04f9512c2a01d21d2f4d4bb6aef257f011cb4dbe Mon Sep 17 00:00:00 2001 From: Enrico Ros Date: Wed, 20 Nov 2024 22:47:27 -0800 Subject: [PATCH] Vercel: serverless functions timeout to 60 Do it the proper way, as the vercel_Production file only caused troubles. --- app/api/cloud/[trpc]/route.ts | 5 ++--- docs/customizations.md | 5 +---- vercel_PRODUCTION.json | 7 ------- 3 files changed, 3 insertions(+), 14 deletions(-) delete mode 100644 vercel_PRODUCTION.json diff --git a/app/api/cloud/[trpc]/route.ts b/app/api/cloud/[trpc]/route.ts index 665f16137..eaf6e23f6 100644 --- a/app/api/cloud/[trpc]/route.ts +++ b/app/api/cloud/[trpc]/route.ts @@ -16,9 +16,8 @@ const handlerNodeRoutes = (req: Request) => fetchRequestHandler({ // NOTE: the following statement breaks the build on non-pro deployments, and conditionals don't work either -// so we resorted to raising the timeout from 10s to 25s in the vercel.json file instead -// export const maxDuration = 25; - +// so we resorted to raising the timeout from 10s to 60s in the vercel.json file instead +export const maxDuration = 60; export const runtime = 'nodejs'; export const dynamic = 'force-dynamic'; export { handlerNodeRoutes as GET, handlerNodeRoutes as POST }; \ No newline at end of file diff --git a/docs/customizations.md b/docs/customizations.md index b240ae1b1..a608223bf 100644 --- a/docs/customizations.md +++ b/docs/customizations.md @@ -31,14 +31,11 @@ At time of writing, big-AGI has only 2 operations that run on Node.js Functions: browsing (fetching web pages) and sharing. They both can exceed 10 seconds, especially when fetching large pages or waiting for websites to be completed. -We provide `vercel_PRODUCTION.json` to raise the duration to 25 seconds (from a default of 10), to use it, -make sure to rename it to `vercel.json` before build. - From the Vercel Project > Settings > General > Build & Development Settings, you can for instance set the build command to: ```bash -mv vercel_PRODUCTION.json vercel.json; next build +next build ``` ### Change the Personas (v1.x only) diff --git a/vercel_PRODUCTION.json b/vercel_PRODUCTION.json deleted file mode 100644 index e50007e5d..000000000 --- a/vercel_PRODUCTION.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "functions": { - "api/cloud/**/*": { - "maxDuration": 30 - } - } -} \ No newline at end of file