Fix build

This commit is contained in:
Adria Navarro 2024-02-19 17:37:25 +01:00
parent 288d5eea6c
commit 6cd6b21f83
1 changed files with 7 additions and 3 deletions

View File

@ -7,6 +7,7 @@ import querystring from "querystring"
import { BundleType, loadBundle } from "../bundles"
import { VM } from "@budibase/types"
import environment from "../../environment"
class ExecutionTimeoutError extends Error {
constructor(message: string) {
@ -33,10 +34,13 @@ export class IsolatedVM implements VM {
invocationTimeout,
isolateAccumulatedTimeout,
}: {
memoryLimit: number
invocationTimeout: number
memoryLimit?: number
invocationTimeout?: number
isolateAccumulatedTimeout?: number
}) {
} = {}) {
memoryLimit = memoryLimit || environment.JS_RUNNER_MEMORY_LIMIT
invocationTimeout = memoryLimit || 1000
this.isolate = new ivm.Isolate({ memoryLimit })
this.vm = this.isolate.createContextSync()
this.jail = this.vm.global