Allow configuring memory limits
This commit is contained in:
parent
f2aeb56671
commit
805b24975b
|
@ -95,6 +95,8 @@ const environment = {
|
||||||
TOP_LEVEL_PATH:
|
TOP_LEVEL_PATH:
|
||||||
process.env.TOP_LEVEL_PATH || process.env.SERVER_TOP_LEVEL_PATH,
|
process.env.TOP_LEVEL_PATH || process.env.SERVER_TOP_LEVEL_PATH,
|
||||||
APP_MIGRATION_TIMEOUT: parseIntSafe(process.env.APP_MIGRATION_TIMEOUT),
|
APP_MIGRATION_TIMEOUT: parseIntSafe(process.env.APP_MIGRATION_TIMEOUT),
|
||||||
|
JS_RUNNER_MEMORY_LIMIT:
|
||||||
|
parseIntSafe(process.env.JS_RUNNER_MEMORY_LIMIT) || 64,
|
||||||
}
|
}
|
||||||
|
|
||||||
// threading can cause memory issues with node-ts in development
|
// threading can cause memory issues with node-ts in development
|
||||||
|
|
|
@ -27,7 +27,9 @@ export function init() {
|
||||||
|
|
||||||
const isolateRefs = bbCtx.isolateRefs
|
const isolateRefs = bbCtx.isolateRefs
|
||||||
if (!isolateRefs) {
|
if (!isolateRefs) {
|
||||||
const jsIsolate = new ivm.Isolate({ memoryLimit: 64 })
|
const jsIsolate = new ivm.Isolate({
|
||||||
|
memoryLimit: env.JS_RUNNER_MEMORY_LIMIT,
|
||||||
|
})
|
||||||
const jsContext = jsIsolate.createContextSync()
|
const jsContext = jsIsolate.createContextSync()
|
||||||
|
|
||||||
const injectedRequire = `const require = function(val){
|
const injectedRequire = `const require = function(val){
|
||||||
|
|
Loading…
Reference in New Issue