Node JS app crashing itself even after using forever JS

那年仲夏 提交于 2019-12-01 01:54:57

I suspect memory issues. Brute forcing forever restarts (cron's etc) will only mask the real issue.

Add this to your code:

process.on('uncaughtException', function (err) {
  console.log("Uncaught Exception:", err);
  process.exit(1);  // This is VITAL. Don't swallow the err and try to continue.
});

This will allow you to begin the process of diagnosing what is causing your node server to fail.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!