diff --git a/init_method.go b/init_method.go index b205478..c199a67 100644 --- a/init_method.go +++ b/init_method.go @@ -26,10 +26,10 @@ func agentStartHandler() { func agentEndHandler() { agentEnd := make(chan interface{}, 0) - observer.Add(messages.AGT_WILL_STOPPED, agentEnd) + observer.Add(messages.AGT_WILL_STOP, agentEnd) go func() { _ = <-agentEnd - observer.Remove(messages.AGT_WILL_STOPPED, agentEnd) + observer.Remove(messages.AGT_WILL_STOP, agentEnd) observer.Remove(messages.TASK_SENSOR_ADD,_configManager.addCh) observer.Remove(messages.TASK_SENSOR_REMOVE,_configManager.removeCh) }()