diff --git a/servers/fern-bot/serverless.yml b/servers/fern-bot/serverless.yml index 2d25b88388..11b99863b0 100644 --- a/servers/fern-bot/serverless.yml +++ b/servers/fern-bot/serverless.yml @@ -6,6 +6,10 @@ provider: runtime: nodejs18.x deploymentMethod: direct region: "us-east-1" + # 900 second timeout, e.g. 15 minutes + timeout: 900 + # 10GB memory + memorySize: 10240 environment: AWS_NODEJS_CONNECTION_REUSE_ENABLED: "1" NODE_OPTIONS: "--enable-source-maps --stack-trace-limit=1000" @@ -20,6 +24,8 @@ provider: REPO_TO_RUN_ON: ${env:REPO_TO_RUN_ON, 'OMIT'} functions: updateOpenApiSpec: + # 10GB storage + ephemeralStorageSize: 10240 handler: "src/functions/oas-cron/updateOpenApiSpec.handler" # Adding a layer to have git available in the lambda # https://github.com/lambci/git-lambda-layer diff --git a/servers/fern-bot/src/functions/oas-cron/actions/updateOpenApiSpecs.ts b/servers/fern-bot/src/functions/oas-cron/actions/updateOpenApiSpecs.ts index fd08038cfb..20566cde26 100644 --- a/servers/fern-bot/src/functions/oas-cron/actions/updateOpenApiSpecs.ts +++ b/servers/fern-bot/src/functions/oas-cron/actions/updateOpenApiSpecs.ts @@ -37,7 +37,7 @@ async function updateOpenApiSpecInternal( const authedCloneUrl = repository.clone_url.replace("https://", `https://x-access-token:${installationToken}@`); // Clone the repo to fullRepoPath and update the branch - await git.clone(authedCloneUrl, "."); + await git.clone(authedCloneUrl, ".", ["--depth", "1"]); // Configure git to show the app as the committer await git.addConfig("user.name", fernBotLoginName); await git.addConfig("user.email", `${fernBotLoginId}+${fernBotLoginName}@users.noreply.github.com`);