简体   繁体   English

错误:永远检测到的脚本已退出,代码为:1

[英]error: Forever detected script exited with code: 1

I am using forever to restart a nodejs-app in case it crashes. 我一直使用它来重启nodejs-app,以防它崩溃。 In some situations the app does not get restarted. 在某些情况下,该应用不会重启。 Forever just displays the message: 永远只显示以下消息:

error: Forever detected script exited with code: 1 错误:永远检测到的脚本已退出,代码为:1

I do not want to solve the issue within the app itself, I just need forever to restart over and over again. 我不想解决应用程序本身的问题,我只需要永远一遍又一遍地重启即可。 Maybe I am missing a paremeter? 也许我错过了参数表?

The other questions concerning forever not restarting here on SO do not address my specific case. 关于永远不会在此处重新启动的其他问题不能解决我的具体情况。

I think I solved it: 我想我解决了:

As ist seems both parameters --minUptime and --spinSleepTime have to be set. 看起来,两个参数--minUptime和--spinSleepTime都必须设置。 Otherwise a so called "spinning" script will not be restarted. 否则,将不会重新启动所谓的“旋转”脚本。

So in order to restart a "spinning" script forever needs to have both parameters set like: 因此,为了永远重新启动“旋转”脚本,需要将两个参数都设置为:

forever --minUptime 5000 --spinSleepTime 3000 app.js 永远--minUptime 5000 --spinSleepTime 3000 app.js

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM