From c1ca0aa45c3d171c5b0b7e720e6e78101ee0647c Mon Sep 17 00:00:00 2001 From: "insanity@loafle.com" Date: Fri, 28 Apr 2017 13:16:53 +0900 Subject: [PATCH] data_sender --- data_sender.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/data_sender.go b/data_sender.go index ee4cf2e..10db22e 100644 --- a/data_sender.go +++ b/data_sender.go @@ -16,7 +16,6 @@ import ( ) const ( - CENTRAL_ADDR = "127.0.0.1:50052" FILE_PATH = "/overflow/tmp/data.tmp" DEFAULT_INTERVAL = 10 ) @@ -77,7 +76,7 @@ func (ds *DataSender) start() { }) } func (ds *DataSender) Stop() { - + observer.Notify(messages.DATA_SENDER_STOPPED, true) } func (ds *DataSender) handleData(qc chan interface{}) { @@ -99,7 +98,8 @@ func (ds *DataSender) send(data []*Data) { ds.addFailedData(data) - conn, err := grpc.Dial(CENTRAL_ADDR, grpc.WithInsecure()) + addr := ds.gconf.Central.Address + ":" + string(ds.gconf.Central.Port) + conn, err := grpc.Dial(addr, grpc.WithInsecure()) if err != nil { ds.saveFailedData(data) return