mirror of
https://github.com/Unitech/pm2.git
synced 2025-12-08 20:35:53 +00:00
19 lines
343 B
JavaScript
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);
|