I'm trying to stop a node js app from continuing to execute new code. I thought about using an infinite timeout, but that seems cludgy. Is there a halt execution of sorts without exiting the application?
I'm currently just using setTimeout to some long time, and the application starts.
I'm currently using pm2 to keep the application running, in case there's an error. But if I have my config files set to "disable", I'd like the application to stay "active" but not doing anything.
When the config is updated, a pm2 restart
is completed, and it's restarted and if the program is set to be enabled, it will continue execution, if it's set to disabled, it should sit there and do nothing.
I keep pm2
running the application, as it lets me know that the application is functional, and not restarting unless I tell it to.
Ideas?