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())