Respond to Adri's feedback.
This commit is contained in:
parent
ce599e775f
commit
9b91e47220
1 changed files with 3 additions and 6 deletions
|
@ -16,16 +16,13 @@ export function init() {
|
||||||
try {
|
try {
|
||||||
const bbCtx = context.getCurrentContext()
|
const bbCtx = context.getCurrentContext()
|
||||||
|
|
||||||
let vm: VM
|
const vm =
|
||||||
if (bbCtx && bbCtx.vm) {
|
bbCtx?.vm ||
|
||||||
vm = bbCtx.vm
|
new IsolatedVM({
|
||||||
} else {
|
|
||||||
vm = new IsolatedVM({
|
|
||||||
memoryLimit: env.JS_RUNNER_MEMORY_LIMIT,
|
memoryLimit: env.JS_RUNNER_MEMORY_LIMIT,
|
||||||
invocationTimeout: env.JS_PER_INVOCATION_TIMEOUT_MS,
|
invocationTimeout: env.JS_PER_INVOCATION_TIMEOUT_MS,
|
||||||
isolateAccumulatedTimeout: env.JS_PER_REQUEST_TIMEOUT_MS,
|
isolateAccumulatedTimeout: env.JS_PER_REQUEST_TIMEOUT_MS,
|
||||||
}).withHelpers()
|
}).withHelpers()
|
||||||
}
|
|
||||||
|
|
||||||
if (bbCtx && !bbCtx.vm) {
|
if (bbCtx && !bbCtx.vm) {
|
||||||
bbCtx.vm = vm
|
bbCtx.vm = vm
|
||||||
|
|
Loading…
Reference in a new issue