pm25
Version:
Production process manager for Node.JS applications with a built-in load balancer.
22 lines (18 loc) • 385 B
JavaScript
/*
* Example of graceful exit that does not listen
*
* $ pm2 gracefulReload all
*/
process.on('message', function(msg) {
if (msg == 'shutdown') {
console.log('Closing all connections...');
setTimeout(function() {
console.log('Finished closing connections');
process.exit(0);
}, 1500);
}
});
setInterval(function ()
{
console.log('tick');
}, 4000);