Fix ac monitor status checking in server console

This commit is contained in:
Ryan Huffman 2016-02-09 15:01:24 -08:00
parent 9e9c124d0b
commit 5f1a159e1d
2 changed files with 3 additions and 5 deletions

View file

@ -61,7 +61,6 @@ ready = function() {
var oldLogFilePaths = Object.keys(watchList);
var diff = difference(oldLogFilePaths, newLogFilePaths);
console.log('diff', diff);
// For each removed file, remove it from our watch list
diff.subtract.forEach(function(removedLogFilePath) {
watchList[removedLogFilePath].unwatch();

View file

@ -272,7 +272,7 @@ Process.prototype = extend(Process.prototype, {
// ACMonitorProcess is an extension of Process that keeps track of the AC Montior's
// children status and log locations.
const CHECK_AC_STATUS_INTERVAL = 5000;
const CHECK_AC_STATUS_INTERVAL = 1000;
function ACMonitorProcess(name, path, args, httpStatusPort, logPath) {
Process.call(this, name, path, args, logPath);
@ -312,7 +312,6 @@ ACMonitorProcess.prototype = extend(ACMonitorProcess.prototype, {
stderr: this.childServers[pid].logStderr
}
}
console.log(logs);
return logs;
},
_updateACMonitorStatus: function() {
@ -325,18 +324,18 @@ ACMonitorProcess.prototype = extend(ACMonitorProcess.prototype, {
return;
}
console.log("Checking AC Monitor status");
var options = {
url: "http://localhost:" + this.httpStatusPort + "/status",
json: true
};
this.pendingRequest = request(options, function(error, response, body) {
this.pendingRequest = null;
if (error) {
console.error('ERROR Getting AC Monitor status', error);
} else {
this.childServers = body.servers;
}
console.log(body);
this.emit('logs-updated');