collector
This commit is contained in:
parent
f980983015
commit
7d45006130
|
@ -80,7 +80,7 @@ func (c *Collector) addObservers() {
|
||||||
go c.handleCrawlerUpdateDone()
|
go c.handleCrawlerUpdateDone()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Collector) Stop() {
|
func (c *Collector) Stop(d interface{}) {
|
||||||
c.cleanObserver(c.addSensorCh, c.remSensorCh)
|
c.cleanObserver(c.addSensorCh, c.remSensorCh)
|
||||||
c.scheduler.RemoveAllSchedule()
|
c.scheduler.RemoveAllSchedule()
|
||||||
c.scheduler.Stop()
|
c.scheduler.Stop()
|
||||||
|
|
|
@ -28,12 +28,10 @@ func (c *Collector) notifyCollectorStopped() {
|
||||||
|
|
||||||
func (c *Collector) handleAgentWillStop() {
|
func (c *Collector) handleAgentWillStop() {
|
||||||
ch := make(chan interface{}, 0)
|
ch := make(chan interface{}, 0)
|
||||||
observer.Add(messages.AGT_WILL_STOPPED, ch)
|
observer.Add(messages.AGT_WILL_STOP, ch)
|
||||||
data := <-ch
|
data := <-ch
|
||||||
if data {
|
c.Stop(data)
|
||||||
c.Stop()
|
observer.Remove(messages.AGT_WILL_STOP, ch)
|
||||||
}
|
|
||||||
observer.Remove(messages.AGT_WILL_STOPPED, ch)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Collector) handleSensorStart() {
|
func (c *Collector) handleSensorStart() {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user