mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-25 20:55:10 +02:00
Fix ac monitor status checking in server console
This commit is contained in:
parent
9e9c124d0b
commit
5f1a159e1d
2 changed files with 3 additions and 5 deletions
|
@ -61,7 +61,6 @@ ready = function() {
|
||||||
|
|
||||||
var oldLogFilePaths = Object.keys(watchList);
|
var oldLogFilePaths = Object.keys(watchList);
|
||||||
var diff = difference(oldLogFilePaths, newLogFilePaths);
|
var diff = difference(oldLogFilePaths, newLogFilePaths);
|
||||||
console.log('diff', diff);
|
|
||||||
// For each removed file, remove it from our watch list
|
// For each removed file, remove it from our watch list
|
||||||
diff.subtract.forEach(function(removedLogFilePath) {
|
diff.subtract.forEach(function(removedLogFilePath) {
|
||||||
watchList[removedLogFilePath].unwatch();
|
watchList[removedLogFilePath].unwatch();
|
||||||
|
|
|
@ -272,7 +272,7 @@ Process.prototype = extend(Process.prototype, {
|
||||||
|
|
||||||
// ACMonitorProcess is an extension of Process that keeps track of the AC Montior's
|
// ACMonitorProcess is an extension of Process that keeps track of the AC Montior's
|
||||||
// children status and log locations.
|
// children status and log locations.
|
||||||
const CHECK_AC_STATUS_INTERVAL = 5000;
|
const CHECK_AC_STATUS_INTERVAL = 1000;
|
||||||
function ACMonitorProcess(name, path, args, httpStatusPort, logPath) {
|
function ACMonitorProcess(name, path, args, httpStatusPort, logPath) {
|
||||||
Process.call(this, name, path, args, logPath);
|
Process.call(this, name, path, args, logPath);
|
||||||
|
|
||||||
|
@ -312,7 +312,6 @@ ACMonitorProcess.prototype = extend(ACMonitorProcess.prototype, {
|
||||||
stderr: this.childServers[pid].logStderr
|
stderr: this.childServers[pid].logStderr
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
console.log(logs);
|
|
||||||
return logs;
|
return logs;
|
||||||
},
|
},
|
||||||
_updateACMonitorStatus: function() {
|
_updateACMonitorStatus: function() {
|
||||||
|
@ -325,18 +324,18 @@ ACMonitorProcess.prototype = extend(ACMonitorProcess.prototype, {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log("Checking AC Monitor status");
|
|
||||||
var options = {
|
var options = {
|
||||||
url: "http://localhost:" + this.httpStatusPort + "/status",
|
url: "http://localhost:" + this.httpStatusPort + "/status",
|
||||||
json: true
|
json: true
|
||||||
};
|
};
|
||||||
this.pendingRequest = request(options, function(error, response, body) {
|
this.pendingRequest = request(options, function(error, response, body) {
|
||||||
|
this.pendingRequest = null;
|
||||||
|
|
||||||
if (error) {
|
if (error) {
|
||||||
console.error('ERROR Getting AC Monitor status', error);
|
console.error('ERROR Getting AC Monitor status', error);
|
||||||
} else {
|
} else {
|
||||||
this.childServers = body.servers;
|
this.childServers = body.servers;
|
||||||
}
|
}
|
||||||
console.log(body);
|
|
||||||
|
|
||||||
this.emit('logs-updated');
|
this.emit('logs-updated');
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue