increase sandbox timeout

This commit is contained in:
Henry
2025-08-27 21:22:13 +08:00
parent af1464f7c2
commit 9b3971d8d8
+2 -2
View File
@@ -1400,7 +1400,7 @@ export const executeJavaScriptCode = async (
nodeVMOptions?: ICommonObject nodeVMOptions?: ICommonObject
} = {} } = {}
): Promise<any> => { ): Promise<any> => {
const { timeout = 10000, useSandbox = true, streamOutput, libraries = [], nodeVMOptions = {} } = options const { timeout = 300000, useSandbox = true, streamOutput, libraries = [], nodeVMOptions = {} } = options
const shouldUseSandbox = useSandbox && process.env.E2B_APIKEY const shouldUseSandbox = useSandbox && process.env.E2B_APIKEY
if (shouldUseSandbox) { if (shouldUseSandbox) {
@@ -1458,7 +1458,7 @@ export const executeJavaScriptCode = async (
} }
} }
const sbx = await Sandbox.create({ apiKey: process.env.E2B_APIKEY }) const sbx = await Sandbox.create({ apiKey: process.env.E2B_APIKEY, timeoutMs: timeout })
// Install libraries // Install libraries
for (const library of libraries) { for (const library of libraries) {