AGENT_STARTING change

This commit is contained in:
geek 2017-05-11 18:02:10 +09:00
parent 57646371c0
commit ac6eb35e35

View File

@ -7,7 +7,7 @@ import (
func agentStartHandler() {
agentStart := make(chan interface{}, 0)
observer.Add(messages.AGENT_STARTED, agentStart)
observer.Add(messages.AGT_STARTING, agentStart)
go func() {
data := <-agentStart
path := data.(string)
@ -19,17 +19,17 @@ func agentStartHandler() {
// error process
}
observer.Remove(messages.AGENT_STARTED, agentStart)
observer.Remove(messages.AGT_STARTING, agentStart)
observer.Notify(messages.CFG_LOADED, _configManager)
}()
}
func agentEndHandler() {
agentEnd := make(chan interface{}, 0)
observer.Add(messages.AGENT_WILL_STOPPED, agentEnd)
observer.Add(messages.AGT_WILL_STOPPED, agentEnd)
go func() {
_ = <-agentEnd
observer.Remove(messages.AGENT_WILL_STOPPED, agentEnd)
observer.Remove(messages.AGT_WILL_STOPPED, agentEnd)
observer.Remove(messages.TASK_SENSOR_ADD,_configManager.addCh)
observer.Remove(messages.TASK_SENSOR_REMOVE,_configManager.removeCh)
}()