Created
April 21, 2014 18:52
-
-
Save solomon23/11152544 to your computer and use it in GitHub Desktop.
failing pm2 unit test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* 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