mirror of
https://github.com/simstudioai/sim.git
synced 2026-02-11 07:04:58 -05:00
improvement(functions): increase function block timeout to 3 min (#1641)
* improvement(functions): increase function block timeout to 3 min * fix tests * use shared constant * remove comment
This commit is contained in:
committed by
GitHub
parent
061c1dff4e
commit
fd67fd220c
@@ -1,6 +1,7 @@
|
||||
import { createContext, Script } from 'vm'
|
||||
import { type NextRequest, NextResponse } from 'next/server'
|
||||
import { env, isTruthy } from '@/lib/env'
|
||||
import { MAX_EXECUTION_DURATION } from '@/lib/execution/constants'
|
||||
import { executeInE2B } from '@/lib/execution/e2b'
|
||||
import { CodeLanguage, DEFAULT_CODE_LANGUAGE, isValidCodeLanguage } from '@/lib/execution/languages'
|
||||
import { createLogger } from '@/lib/logs/console/logger'
|
||||
@@ -8,7 +9,7 @@ import { validateProxyUrl } from '@/lib/security/input-validation'
|
||||
import { generateRequestId } from '@/lib/utils'
|
||||
export const dynamic = 'force-dynamic'
|
||||
export const runtime = 'nodejs'
|
||||
export const maxDuration = 60
|
||||
export const maxDuration = MAX_EXECUTION_DURATION
|
||||
|
||||
const logger = createLogger('FunctionExecuteAPI')
|
||||
|
||||
@@ -649,10 +650,12 @@ export async function POST(req: NextRequest) {
|
||||
try {
|
||||
const body = await req.json()
|
||||
|
||||
const { DEFAULT_EXECUTION_TIMEOUT_MS } = await import('@/lib/execution/constants')
|
||||
|
||||
const {
|
||||
code,
|
||||
params = {},
|
||||
timeout = 5000,
|
||||
timeout = DEFAULT_EXECUTION_TIMEOUT_MS,
|
||||
language = DEFAULT_CODE_LANGUAGE,
|
||||
useLocalVM = false,
|
||||
envVars = {},
|
||||
|
||||
Reference in New Issue
Block a user