sd
This commit is contained in:
parent
624e73c186
commit
0df5921614
|
@ -3,7 +3,7 @@ package event_sender_go
|
|||
import (
|
||||
"context"
|
||||
"google.golang.org/grpc"
|
||||
"loafle.com/overflow/agent_api/observer/messages"
|
||||
//"loafle.com/overflow/agent_api/observer/messages"
|
||||
pb "loafle.com/overflow/crawler_go/grpc"
|
||||
q "loafle.com/overflow/queue_go"
|
||||
"log"
|
||||
|
@ -76,6 +76,7 @@ func Start(ch chan bool) (err error) {
|
|||
func Stop() (err error) {
|
||||
es := GetInstance()
|
||||
es.stop()
|
||||
return nil
|
||||
}
|
||||
func AddEventData(event interface{}) {
|
||||
es := GetInstance()
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package event_sender_go
|
||||
|
||||
import (
|
||||
"loafle.com/overflow/agent_api/observer"
|
||||
"loafle.com/overflow/agent_api/observer/messages"
|
||||
//"loafle.com/overflow/agent_api/observer"
|
||||
//"loafle.com/overflow/agent_api/observer/messages"
|
||||
"log"
|
||||
"strconv"
|
||||
"testing"
|
||||
|
@ -11,8 +11,13 @@ import (
|
|||
|
||||
func TestEventSender_Start(t *testing.T) {
|
||||
|
||||
observer.Notify("CONFIGMANAGER_LOADED", nil)
|
||||
//observer.Notify("CONFIGMANAGER_LOADED", nil)
|
||||
|
||||
c := make(chan bool)
|
||||
err := Start(c)
|
||||
if err != nil {
|
||||
log.Println("err: ", err)
|
||||
}
|
||||
time.Sleep(time.Second * 5)
|
||||
|
||||
testNotify()
|
||||
|
@ -23,6 +28,7 @@ func TestEventSender_Start(t *testing.T) {
|
|||
|
||||
func testNotify() {
|
||||
//time.Sleep(time.Second * 5)
|
||||
//es := GetInstance()
|
||||
|
||||
for i := 0; i < 20; i++ {
|
||||
result := make(map[string]string)
|
||||
|
@ -34,8 +40,8 @@ func testNotify() {
|
|||
SensorId: "insanity",
|
||||
Data: result,
|
||||
}
|
||||
|
||||
observer.Notify(messages.QUEUE_EVENT, cd)
|
||||
AddEventData(cd)
|
||||
//observer.Notify(messages.QUEUE_EVENT, cd)
|
||||
}
|
||||
log.Println("New data Notify")
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user