From 61c2a99b0e80c7df716607101a4d40aa1ba2831d Mon Sep 17 00:00:00 2001 From: Rob Gordon Date: Tue, 31 Oct 2023 15:39:57 -0400 Subject: [PATCH] Extend serverless function duration --- api/data/import.ts | 4 +--- api/prompt/text.ts | 2 ++ 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/api/data/import.ts b/api/data/import.ts index 6259db837..126d88a5f 100644 --- a/api/data/import.ts +++ b/api/data/import.ts @@ -1,9 +1,7 @@ import { VercelRequest, VercelResponse } from "@vercel/node"; import { parse } from "csv-parse/sync"; -// eslint-disable-next-line @typescript-eslint/ban-ts-comment -// @ts-ignore -import type { Readable } from "node:stream"; +export const maxDuration = 60; // 1 minutes /** * Receives text/csv content in post request diff --git a/api/prompt/text.ts b/api/prompt/text.ts index dde35cb31..486285cf2 100644 --- a/api/prompt/text.ts +++ b/api/prompt/text.ts @@ -5,6 +5,8 @@ import { stringify } from "graph-selector"; type PromptType = "knowledge" | "flowchart"; +export const maxDuration = 60 * 5; // 5 minutes + const handler: VercelApiHandler = async (req, res) => { const { subject, promptType, accentClasses = [] } = req.body; if (!subject || !promptType || !isPromptType(promptType)) {