The server auto-kills when a major error occurs

This commit is contained in:
Gaël Métais
2014-09-05 19:04:25 +02:00
parent 839a891e9d
commit b730249b34
2 changed files with 17 additions and 0 deletions
+10
View File
@@ -69,6 +69,13 @@ var PhantomasWrapper = function() {
}
console.log('node node_modules/phantomas/bin/phantomas.js --url=' + task.url + optionsString + ' --verbose');
// Kill the application if nothing happens for 10 minutes
var killer = setTimeout(function() {
console.log('Killing the server because the test ' + task.testId + ' on ' + task.url + ' was launched 10 minutes ago');
// Forever will restart the server
process.exit(1);
}, 600000);
// It's time to launch the test!!!
var triesNumber = 3;
@@ -98,6 +105,9 @@ var PhantomasWrapper = function() {
cb(err, {json: json, results: results});
});
}, function(err, data) {
clearTimeout(killer);
if (err) {
console.log('All ' + triesNumber + ' attemps failed for test id ' + task.testId);
}
+7
View File
@@ -62,6 +62,13 @@
document.body.className = '';
});
socket.on('reconnect_error', function() {
statusElement.innerHTML = "Server reboot. Please start a new test."
// Stop the spinner
document.body.className = '';
});
askStatus();