fix webserver service check
This commit is contained in:
parent
113bb25142
commit
14d330a729
|
@ -178,8 +178,18 @@ class Engine {
|
|||
});
|
||||
|
||||
self.servicesMonitor.addCheck('Webserver', function (cb) {
|
||||
let devServer = 'Webserver (http://' + host + ':' + port + ')';
|
||||
return cb({name: devServer, status: 'on'});
|
||||
utils.checkIsAvailable('http://' + host + ':' + port, function (available) {
|
||||
let devServer = 'Webserver (http://' + host + ':' + port + ')';
|
||||
if (available) {
|
||||
return cb({name: devServer, status: 'on'});
|
||||
} else {
|
||||
return cb({name: devServer, status: 'off'});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
self.events.on('check:wentOffline:Webserver', function () {
|
||||
self.logger.info("Webserver is offline");
|
||||
});
|
||||
|
||||
self.events.setCommandHandler('start-webserver', function() {
|
||||
|
|
|
@ -45,7 +45,7 @@ class Console {
|
|||
utils.exit();
|
||||
} else if (cmd === 'webserver start') {
|
||||
this.events.request("start-webserver");
|
||||
return "starting webserver...";
|
||||
return " ";
|
||||
} else if (cmd === 'webserver stop') {
|
||||
this.events.request("stop-webserver");
|
||||
return "stopping webserver...";
|
||||
|
|
Loading…
Reference in New Issue