From ac6eb35e35dd3b840fbc6789ed798ab4b04e5dfa Mon Sep 17 00:00:00 2001 From: geek Date: Thu, 11 May 2017 18:02:10 +0900 Subject: [PATCH] AGENT_STARTING change --- init_method.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/init_method.go b/init_method.go index 5b0e8d7..b205478 100644 --- a/init_method.go +++ b/init_method.go @@ -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) }()