mirror of
https://github.com/Unitech/pm2.git
synced 2026-02-01 16:57:09 +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);
|