Take different action based on number of times npm "forever" restarts

27 views Asked by At

I'm running an express server behind forever. Let's say there are a lot of crashes X within a specified period of time N (due to a runtime error in the newest deploy, for example). Instead of just restarting the script the X+1th time, I want to run a cleanup script that will roll back to a previous version, do some other cleanup, and then restart. Is this possible with forever?

0

There are 0 answers