diff --git a/lib/core/services_monitor.js b/lib/core/services_monitor.js index 2177d5f2..04bdddea 100644 --- a/lib/core/services_monitor.js +++ b/lib/core/services_monitor.js @@ -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;