Skip to content

Instantly share code, notes, and snippets.

@solomon23
Created April 21, 2014 18:52
Show Gist options
  • Save solomon23/11152544 to your computer and use it in GitHub Desktop.
Save solomon23/11152544 to your computer and use it in GitHub Desktop.
failing pm2 unit test
/*
* Example of graceful exit
*
* $ pm2 gracefulReload all
*/
process.on('message', function(msg) {
if (msg == 'shutdown') {
clearInterval(i);
console.log('Closing all connections...');
setTimeout(function() {
console.log('Finished closing connections');
process.exit(0);
}, 1500);
}
});
var i = setInterval(function(){
console.log('tick');
}, 500);
// var http = require('http');
// http.createServer(function(req, res) {
// res.writeHead(200);
// res.end('hey');
// }).listen(8000, function() {
// console.log('listening');
// });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment