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) {
|
||||
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};
|
||||
};
|
||||
|
||||
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() {
|
||||
this.logger.info('startMonitor');
|
||||
var self = this;
|
||||
|
|
Loading…
Reference in New Issue