data_sender
This commit is contained in:
parent
26f82a78b0
commit
c1ca0aa45c
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user