From 4e80885df253dc48430bfc2de6e1ec8c731151ab Mon Sep 17 00:00:00 2001 From: "insanity@loafle.com" Date: Fri, 4 Aug 2017 11:37:00 +0900 Subject: [PATCH] sorm --- initializer/initializer.go | 6 +++--- probe.go | 36 ++++++++++++++++++------------------ 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/initializer/initializer.go b/initializer/initializer.go index 512fceb..cf5968d 100644 --- a/initializer/initializer.go +++ b/initializer/initializer.go @@ -1,7 +1,7 @@ package initializer import ( - cm "git.loafle.net/overflow/overflow_probe//agent_api/config_manager" + cm "git.loafle.net/overflow/overflow_probe/agent_api/config_manager" "google.golang.org/grpc" "sync" ) @@ -46,11 +46,11 @@ func (i *Initializer) getSecretKey() (string, error) { addr := i.gconf.Central.Address + ":" + string(i.gconf.Central.Port) conn, err := grpc.Dial(addr, grpc.WithInsecure()) if err != nil { - return nil, err + return "", err } defer conn.Close() - return nil, nil + return "", nil } diff --git a/probe.go b/probe.go index 1d58c11..0be1cb9 100644 --- a/probe.go +++ b/probe.go @@ -132,9 +132,9 @@ func (agt *Agent) waitAgentTask() { d := <-agt.taskCh task := d.(msg.AgentTask) switch task.Command { - case msg.TASK_POL_INTERVAL_UPDATE: - agt.processUpdatePolInterval(task) - break + //case msg.TASK_POL_INTERVAL_UPDATE: + // agt.processUpdatePolInterval(task) + // break case msg.TASK_SENSOR_START: agt.processStartSensor(task) break @@ -193,12 +193,12 @@ func (agt *Agent) stopAgent() { dat.Stop(datStopped) <-datStopped - //pol stop() - polStopped := make(chan bool, 1) - if err := pol.Stop(polStopped); err != nil { - return - } - <-polStopped + ////pol stop() + //polStopped := make(chan bool, 1) + //if err := pol.Stop(polStopped); err != nil { + // return + //} + //<-polStopped evt.AddEventData(msg.Event{msg.EVT_TYPE_NONE, msg.EVENT_AGT_STOP, nil}) evt.Stop() @@ -281,12 +281,12 @@ func (agt *Agent) processSendLog(task msg.AgentTask) { evt.AddEventData(msg.Event{msg.EVT_TYPE_TASK, task.Params["id"], nil}) } -func (agt *Agent) processUpdatePolInterval(task msg.AgentTask) { - interval := task.Params["interval"] - err := pol.UpdateInterval(interval) - if err != nil { - log.Error(err) - return - } - evt.AddEventData(msg.Event{msg.EVT_TYPE_TASK, task.Params["id"], nil}) -} +//func (agt *Agent) processUpdatePolInterval(task msg.AgentTask) { +// interval := task.Params["interval"] +// err := pol.UpdateInterval(interval) +// if err != nil { +// log.Error(err) +// return +// } +// evt.AddEventData(msg.Event{msg.EVT_TYPE_TASK, task.Params["id"], nil}) +//}