diff --git a/chains/chainApis.js b/chains/chainApis.js index 2aedc32..f4d94f4 100644 --- a/chains/chainApis.js +++ b/chains/chainApis.js @@ -1,6 +1,5 @@ import _ from "lodash" -const BEST_NODE_COUNT = 2 const BEST_HEIGHT_DIFF = 5 const BEST_RESPONSE_DIFF = 1 const BEST_ERROR_DIFF = 5 * 60 @@ -8,7 +7,7 @@ const IGNORE_ERROR_DIFF = 60 * 60 function ChainApis(apis, health) { function bestAddress(type) { - const urls = bestUrls(type)//.slice(0, BEST_NODE_COUNT) + const urls = bestUrls(type) const best = _.sample(urls) return best && best.address } diff --git a/ecosystem.production.json b/ecosystem.production.json index 035e509..3d78690 100644 --- a/ecosystem.production.json +++ b/ecosystem.production.json @@ -2,7 +2,8 @@ "name": "app", "script": "app.js", "instances": 5, - "cron_restart": "0 */3 * * *" + "cron_restart": "0 */3 * * *", + "max_memory_restart": "200M" }, { "name": "worker", "script": "worker.js", diff --git a/proxy/proxyController.js b/proxy/proxyController.js index 990610f..caf5094 100644 --- a/proxy/proxyController.js +++ b/proxy/proxyController.js @@ -186,6 +186,7 @@ const ProxyController = (client, registry) => { resolve() }) + // Causes major memory leak // proxy.on('proxyRes', (proxyRes, req, res) => { // proxyRes.headers["x-forwarded-to"] = ctx.state.proxyUrl; // });