nanny
nanny copied to clipboard
Event order + Fixes
Worker state change events need to be hooked up before the process is started. This is achieved by initializing the process on next tick.
However, this breaks the assumption that worker.process exists immediately after initialization. To work around this, we re-emit the process message on the worker and subscribe to worker.on('message', ...)
instead.
Also fixes a minor edge case where workers do not restart if the restart delay is 0.
Looks good to me.
Thank you for your submission, we really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.