Skip to content

Commit

Permalink
simple script to monitor process
Browse files Browse the repository at this point in the history
  • Loading branch information
jwcooper committed Feb 9, 2018
1 parent 008e44a commit b2b73e8
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
12 changes: 12 additions & 0 deletions monitor.js
@@ -0,0 +1,12 @@
var forever = require('forever-monitor');

var child = new (forever.Monitor)('server.js', {
silent: false,
args: []
});

child.on('exit', function () {
console.log('your-filename.js has exited after 3 restarts');
});

child.start();
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -10,6 +10,7 @@
"express": "4.16.2",
"express-session": "1.12.1",
"express-ws": "3.0.0",
"forever-monitor": "^1.7.1",
"gitty": "^3.6.0",
"jsDAV": "0.3.4",
"later": "^1.2.0",
Expand Down
6 changes: 6 additions & 0 deletions server.js
Expand Up @@ -254,3 +254,9 @@ process.on('SIGINT', function() {
});
process.exit();
});

// process.on('uncaughtException', function(err) {
// debug_helper.kill_debug(false, function() {
// //no need to wait for this
// });
// });

0 comments on commit b2b73e8

Please sign in to comment.