This commit is contained in:
crusader 2018-05-04 20:57:16 +09:00
parent f27edde6a6
commit fd4bdf3551

View File

@ -89,6 +89,7 @@ func (s *CollectorService) RemoveSensorConfigs(sensorConfigs []*ocmsc.SensorConf
} }
func (s *CollectorService) addSchedule(interval int64, sensorConfig *ocmsc.SensorConfig) { func (s *CollectorService) addSchedule(interval int64, sensorConfig *ocmsc.SensorConfig) {
s.removeSchedule(sensorConfig.ConfigID)
scheduleID, err := s.scheduler.RunEvery(time.Duration(interval)*time.Second, s.collectTask, sensorConfig) scheduleID, err := s.scheduler.RunEvery(time.Duration(interval)*time.Second, s.collectTask, sensorConfig)
if nil != err { if nil != err {
logging.Logger().Errorf("Cannot add schedule for config[%s] %v", sensorConfig.ConfigID, err) logging.Logger().Errorf("Cannot add schedule for config[%s] %v", sensorConfig.ConfigID, err)