mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 08:36:12 +01:00
feat: allow setting max-old-space-size in config
This commit is contained in:
@@ -99,7 +99,9 @@ Loader.start = function () {
|
|||||||
function forkWorker(index, isPrimary) {
|
function forkWorker(index, isPrimary) {
|
||||||
const ports = getPorts();
|
const ports = getPorts();
|
||||||
const args = [];
|
const args = [];
|
||||||
|
if (nconf.get('max-memory')) {
|
||||||
|
args.push(`--max-old-space-size=${nconf.get('max-memory')}`);
|
||||||
|
}
|
||||||
if (!ports[index]) {
|
if (!ports[index]) {
|
||||||
return console.log(`[cluster] invalid port for worker : ${index} ports: ${ports.length}`);
|
return console.log(`[cluster] invalid port for worker : ${index} ports: ${ports.length}`);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user