pm2/test/fixtures/delayed_exit.js
2015-03-02 18:31:10 +01:00

19 lines
343 B
JavaScript

var exit = function() {
console.log("Delay exit in 2 secs");
setTimeout(function(){
process.exit();
}, 2000);
};
process.on('SIGTERM', function() {
console.log('Got SIGTERM signal.');
exit();
});
process.on('SIGINT', function() {
console.log('Got SIGINT signal');
exit();
});
setInterval(function keepMeAlive() {}, 1000);