adding onError hook
craftycram opened this issue · 6 comments
Hello,
I recently got some cases where my prehook script or reload would fail and I didn't notice until taking a look into the logs.
For a successful reload I added a webhook into my posthook which notifies me once the redeploy was successfull.
I would love having that ability in case of an failure as well. I was thinking about adding a third hook to the configuration which gets executed when an error gets catched.
Are you planning on adding that feature?
If not I would just create a pull request and add it myself.
Then you can decide if you want to merge it into your version as well.
Kind regards,
Marc
Hi Marc ! I stopped using pm2 few years back but if you want to make a PR i will happily review it then release it :)
Alright. I'm also open for any recommendations or alternatives to pm2.
I was just looking for an easy deployment option for my node / typescript backends.
At work i went on to use kubernetes (which is generally way overkill for small deployment) but otherwise i heavily use directly systemd (which pm2 uses to get restarted itself). I've wrote https://github.com/vmarchaud/servicectl as a simple CLI to do that but never went much further so it has much less features than pm2
Alright thank you. I'll probably stay with pm2 then. Even docker would be overkill for my case right now.
But I'll take a look at your script there :)
@craftycram I've released it as 1.11.0 !
awesome! thank you very much!