Vercel: serverless functions timeout to 60

Do it the proper way, as the vercel_Production file only caused troubles.
This commit is contained in:
Enrico Ros
2024-11-20 22:47:27 -08:00
parent b9bc4421a3
commit 04f9512c2a
3 changed files with 3 additions and 14 deletions
+2 -3
View File
@@ -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 // 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 // so we resorted to raising the timeout from 10s to 60s in the vercel.json file instead
// export const maxDuration = 25; export const maxDuration = 60;
export const runtime = 'nodejs'; export const runtime = 'nodejs';
export const dynamic = 'force-dynamic'; export const dynamic = 'force-dynamic';
export { handlerNodeRoutes as GET, handlerNodeRoutes as POST }; export { handlerNodeRoutes as GET, handlerNodeRoutes as POST };
+1 -4
View File
@@ -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 browsing (fetching web pages) and sharing. They both can exceed 10 seconds, especially
when fetching large pages or waiting for websites to be completed. 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, From the Vercel Project > Settings > General > Build & Development Settings,
you can for instance set the build command to: you can for instance set the build command to:
```bash ```bash
mv vercel_PRODUCTION.json vercel.json; next build next build
``` ```
### Change the Personas (v1.x only) ### Change the Personas (v1.x only)
-7
View File
@@ -1,7 +0,0 @@
{
"functions": {
"api/cloud/**/*": {
"maxDuration": 30
}
}
}