Merge branch 'enable-sloppy-js' of github.com:Budibase/budibase into enable-sloppy-js
This commit is contained in:
commit
936bf2d9bb
|
@ -7,6 +7,7 @@ import querystring from "querystring"
|
||||||
|
|
||||||
import { BundleType, loadBundle } from "../bundles"
|
import { BundleType, loadBundle } from "../bundles"
|
||||||
import { VM } from "@budibase/types"
|
import { VM } from "@budibase/types"
|
||||||
|
import environment from "../../environment"
|
||||||
|
|
||||||
class ExecutionTimeoutError extends Error {
|
class ExecutionTimeoutError extends Error {
|
||||||
constructor(message: string) {
|
constructor(message: string) {
|
||||||
|
@ -33,10 +34,13 @@ export class IsolatedVM implements VM {
|
||||||
invocationTimeout,
|
invocationTimeout,
|
||||||
isolateAccumulatedTimeout,
|
isolateAccumulatedTimeout,
|
||||||
}: {
|
}: {
|
||||||
memoryLimit: number
|
memoryLimit?: number
|
||||||
invocationTimeout: number
|
invocationTimeout?: number
|
||||||
isolateAccumulatedTimeout?: number
|
isolateAccumulatedTimeout?: number
|
||||||
}) {
|
} = {}) {
|
||||||
|
memoryLimit = memoryLimit || environment.JS_RUNNER_MEMORY_LIMIT
|
||||||
|
invocationTimeout = memoryLimit || 1000
|
||||||
|
|
||||||
this.isolate = new ivm.Isolate({ memoryLimit })
|
this.isolate = new ivm.Isolate({ memoryLimit })
|
||||||
this.vm = this.isolate.createContextSync()
|
this.vm = this.isolate.createContextSync()
|
||||||
this.jail = this.vm.global
|
this.jail = this.vm.global
|
||||||
|
|
Loading…
Reference in New Issue