From 52da0187c7183e142d097567b9e23bf3ccd725f7 Mon Sep 17 00:00:00 2001 From: geek Date: Tue, 16 May 2017 17:25:55 +0900 Subject: [PATCH] evt commit --- event_sender.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/event_sender.go b/event_sender.go index b54112a..a650058 100644 --- a/event_sender.go +++ b/event_sender.go @@ -9,6 +9,7 @@ import ( "log" "reflect" "sync" + "loafle.com/overflow/agent_api/messages" ) var ( @@ -107,7 +108,7 @@ func (es *EventSender) stop() { func (es *EventSender) checkQueue() { - result := make([]*Data, 0) + result := make([]*messages.Event, 0) for sc := range es.sc { items := reflect.ValueOf(sc) @@ -118,9 +119,9 @@ func (es *EventSender) checkQueue() { for i := 0; i < items.Len(); i++ { item := items.Index(i).Elem().Interface() tempCollectedData := item.(q.Item) - collectedData := tempCollectedData.Value.(*Data) - collectedData.AgentId = agentIdentifier() - result = append(result, collectedData) + collectedData := tempCollectedData.Value.(messages.Event) + //collectedData.AgentId = agentIdentifier() + result = append(result, &collectedData) //log.Println("Result Len: ", len(result)) } es.send(result) @@ -129,7 +130,7 @@ func (es *EventSender) checkQueue() { } -func (es *EventSender) send(data []*Data) { +func (es *EventSender) send(data []*messages.Event) { log.Println("Send Started") conn, err := grpc.Dial(CENTRAL_ADDR, grpc.WithInsecure())