ethstats-client/app.js

27 lines
566 B
JavaScript
Raw Normal View History

2015-02-12 13:26:47 +01:00
var nodeModel = require('./lib/node');
2015-02-11 23:54:33 +01:00
2015-02-16 17:44:26 +01:00
var node = new nodeModel();
2015-02-12 13:26:47 +01:00
console.log(node.stats);
var gracefulShutdown = function() {
console.log("Received kill signal, shutting down gracefully.");
node.stop();
console.log("Closed node watcher");
setTimeout(function(){
console.log("Closed out remaining connections.");
process.exit()
}, 2*1000);
2015-02-11 23:21:10 +01:00
}
2015-02-12 13:26:47 +01:00
// listen for TERM signal .e.g. kill
process.on('SIGTERM', gracefulShutdown);
// listen for INT signal e.g. Ctrl-C
process.on('SIGINT', gracefulShutdown);
2015-02-11 23:21:10 +01:00
2015-02-12 23:30:12 +01:00
module.exports = node;