lundi 30 mars 2015

Restart forever.js for a node.js app through a cron?

My node.js app crashes sometimes and sometimes forever.js automatically restarts it and sometimes it does not.


There's nothing in the logs - I run forever with '-e' option but that doesn't save any error log - my main log simply breaks off and that's it...


Tired of trying to figure it out I wonder if there's another solution: can I set up a cron, which would check my URL for 503 code and if it's the case, it would restart the app using forever?


I know how to white a bash script to start forever but how do I check if the URL returns 503 code?


Thanks!


Aucun commentaire:

Enregistrer un commentaire