From a100cd90d3b7ad4afb5150b298a1124ce1479da4 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Thu, 27 Jan 2022 23:01:43 +0000 Subject: [PATCH] Added worker limit --- config_example.json | 1 + lib/pool.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/config_example.json b/config_example.json index 7c070264..78d1944c 100644 --- a/config_example.json +++ b/config_example.json @@ -1,6 +1,7 @@ { "pool_id": 0, "eth_pool_support": 1, + "worker_num": 0, "bind_ip": "127.0.0.1", "hostname": "testpool.com", "db_storage_path": "CHANGEME", diff --git a/lib/pool.js b/lib/pool.js index 2599cc35..f979b52d 100644 --- a/lib/pool.js +++ b/lib/pool.js @@ -2327,7 +2327,7 @@ function getUniqueWorkerID(cb) { } if (cluster.isMaster) { - const numWorkers = require('os').cpus().length; + const numWorkers = global.config.worker_num ? global.config.worker_num : require('os').cpus().length; for (let i = 1; i <= numWorkers; ++ i) { minerCount[i] = []; global.config.ports.forEach(function (portData) {