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