mirror of https://github.com/embarklabs/embark.git
implement stopCheck
This commit is contained in:
parent
2dec088a9b
commit
5cf287a747
|
@ -10,10 +10,16 @@ var ServicesMonitor = function(options) {
|
||||||
|
|
||||||
ServicesMonitor.prototype.addCheck = function(name, checkFn, time) {
|
ServicesMonitor.prototype.addCheck = function(name, checkFn, time) {
|
||||||
this.logger.info('add check: ' + name);
|
this.logger.info('add check: ' + name);
|
||||||
// TODO: check if a service with the same name already exists
|
|
||||||
this.checkList[name] = {fn: checkFn, interval: time || 5000};
|
this.checkList[name] = {fn: checkFn, interval: time || 5000};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
ServicesMonitor.prototype.stopCheck = function(name) {
|
||||||
|
clearInterval(this.checkTimers[name]);
|
||||||
|
delete this.checkTimers[name];
|
||||||
|
delete this.checkList[name];
|
||||||
|
delete this.checkState[name];
|
||||||
|
};
|
||||||
|
|
||||||
ServicesMonitor.prototype.startMonitor = function() {
|
ServicesMonitor.prototype.startMonitor = function() {
|
||||||
this.logger.info('startMonitor');
|
this.logger.info('startMonitor');
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
Loading…
Reference in New Issue