为什么PM2不考虑清晰的退出代码1错误?
我有2个项目在节点V16上运行,一个PM2的旧版本。将节点升级到V16后,两者都停止重新启动错误。我已经将一个升级到PM2 v5.2.0,并解决了问题。
但是,另一个项目仍未重新启动。我尝试仅使用项目中的第一个功能引发的错误进行测试,并使用代码1退出,但是PM2继续显示其状态为在线
。直接从Bash运行它使其崩溃,因此没有充分的理由不检测到这一点。
我非常简单地开始我的过程 - pm2开始名称= project -name yarn-运行start:prod
。这两个项目都是这样启动的。
PM2的GitHub问题充满了有关此的报道,但没有人回答大多数。也许以前遇到过的人有技巧?
I had 2 projects running on Node v16 and an old version of PM2. After upgrading node to v16, both stopped restarting on error. I've upgraded one to PM2 v5.2.0 and it fixed the issue.
However, the other project still does not restart. I tried testing using just an error thrown from the first function called in the project and it exits with code 1, but PM2 continues showing its status as online
. Running it directly from bash makes it crash, so there's no good reason for PM2 not to detect that.
I start my process very simply - pm2 start name=project-name yarn -- run start:prod
. Both projects are launched like this.
PM2's Github issues are full of the reports of this, but no one replies to most of them. Maybe someone who has run into this previously has tips?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论