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