Reputation: 11819
I am using forever to restart a nodejs-app in case it crashes. In some situations the app does not get restarted. Forever just displays the message:
error: Forever detected script exited with code: 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.
Upvotes: 2
Views: 7976
Reputation: 11819
I think I solved it:
As ist seems both parameters --minUptime and --spinSleepTime have to be set. 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
Upvotes: 6