问题描述
pm2 自动重启策略是什么?
我尝试用pm2启动Next.js应用,React渲染错误,pm2可以看到Error日志,但是不会重启。
我尝试使用 Pm2 来启动一个简单的 Koa 应用程序。处理网络请求的时候,触发了一个JS错误,Pm2可以看到Error日志,但是Pm2没有重启。
解决方法
Restart app at a specified CRON time
Restart app when files have changed
Restart when app reach a memory threshold
Delay a start and automatic restart
Disable auto restart (app are always restarted with PM2) when crashing or exiting by default)
Restart application automatically at a specific exponential increasing time
参考链接:https://pm2.keymetrics.io/docs/usage/restart-strategies/
希望这个链接对你有帮助