Skip to content

Commit

Permalink
Merge pull request #12 from eco-stake/memory-bugfix
Browse files Browse the repository at this point in the history
Memory leak bugfix
  • Loading branch information
tombeynon authored Apr 28, 2022
2 parents 9d838bb + 5ca136f commit 6259752
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
3 changes: 2 additions & 1 deletion ecosystem.production.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
7 changes: 4 additions & 3 deletions proxy/proxyController.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,10 @@ const ProxyController = (client, registry) => {
resolve()
})

proxy.on('proxyRes', (proxyRes, req, res) => {
proxyRes.headers["x-forwarded-to"] = ctx.state.proxyUrl;
});
// Causes major memory leak
// proxy.on('proxyRes', (proxyRes, req, res) => {
// proxyRes.headers["x-forwarded-to"] = ctx.state.proxyUrl;
// });

proxy.web(ctx.req, ctx.res, opts, e => {
const status = {
Expand Down

0 comments on commit 6259752

Please sign in to comment.