feat: allow setting max-old-space-size in config

This commit is contained in:
Barış Soner Uşaklı
2024-03-13 10:18:33 -04:00
parent 3b48695b2f
commit d1ce594cc9

View File

@@ -99,7 +99,9 @@ Loader.start = function () {
function forkWorker(index, isPrimary) {
const ports = getPorts();
const args = [];
if (nconf.get('max-memory')) {
args.push(`--max-old-space-size=${nconf.get('max-memory')}`);
}
if (!ports[index]) {
return console.log(`[cluster] invalid port for worker : ${index} ports: ${ports.length}`);
}