Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[node] add maxDuration config support for vc node deployments #10028

Merged
merged 9 commits into from Jun 5, 2023
5 changes: 5 additions & 0 deletions .changeset/tricky-mangos-rule.md
@@ -0,0 +1,5 @@
---
'@vercel/node': minor
---

Add maxDuration config support for vc node deployments
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Super nitpick: Can we replace [edge-compute] in the PR title with [node]? 🙏

1 change: 1 addition & 0 deletions packages/node/src/index.ts
Expand Up @@ -506,6 +506,7 @@ export const build: BuildV3 = async ({
shouldAddSourcemapSupport,
awsLambdaHandler,
supportsResponseStreaming,
maxDuration: staticConfig?.maxDuration,
});
}

Expand Down
1 change: 1 addition & 0 deletions packages/static-config/test/fixtures/deno.ts
Expand Up @@ -4,6 +4,7 @@ import { readerFromStreamReader } from 'https://deno.land/std@0.107.0/io/streams
export const config = {
runtime: 'deno',
location: 'https://example.com/page',
maxDuration: 60
};

export default async ({ request }: Deno.RequestEvent) => {
Expand Down
1 change: 1 addition & 0 deletions packages/static-config/test/fixtures/node.js
Expand Up @@ -3,6 +3,7 @@ import fs from 'fs';
export const config = {
runtime: 'nodejs',
memory: 1024,
maxDuration: 60,
};

export default function (req, res) {
Expand Down
2 changes: 2 additions & 0 deletions packages/static-config/test/index.test.ts
Expand Up @@ -9,6 +9,7 @@ describe('getConfig()', () => {
const config = getConfig(project, sourcePath);
expect(config).toMatchInlineSnapshot(`
{
"maxDuration": 60,
"memory": 1024,
"runtime": "nodejs",
}
Expand All @@ -27,6 +28,7 @@ describe('getConfig()', () => {
expect(config).toMatchInlineSnapshot(`
{
"location": "https://example.com/page",
"maxDuration": 60,
"runtime": "deno",
}
`);
Expand Down
2 changes: 2 additions & 0 deletions packages/static-config/test/swc.test.ts
Expand Up @@ -56,6 +56,7 @@ describe('getConfig for swc', () => {
const config = getConfig(ast, BaseFunctionConfigSchema);
expect(config).toMatchInlineSnapshot(`
{
"maxDuration": 60,
"memory": 1024,
"runtime": "nodejs",
}
Expand All @@ -73,6 +74,7 @@ describe('getConfig for swc', () => {
expect(config).toMatchInlineSnapshot(`
{
"location": "https://example.com/page",
"maxDuration": 60,
"runtime": "deno",
}
`);
Expand Down