mirror of
https://github.com/enricoros/big-AGI.git
synced 2026-05-10 21:50:14 -07:00
Vercel: serverless functions timeout to 60
Do it the proper way, as the vercel_Production file only caused troubles.
This commit is contained in:
@@ -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 };
|
||||||
@@ -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)
|
||||||
|
|||||||
@@ -1,7 +0,0 @@
|
|||||||
{
|
|
||||||
"functions": {
|
|
||||||
"api/cloud/**/*": {
|
|
||||||
"maxDuration": 30
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user