1
0
Fork 0

Minor changes

This commit is contained in:
Ludovic Fernandez 2018-07-03 10:02:03 +02:00 committed by Traefiker Bot
parent bb14ec70bd
commit 17ad5153b8
38 changed files with 93 additions and 182 deletions

View file

@ -154,17 +154,16 @@ func (w *influxDBWriter) Write(bp influxdb.BatchPoints) error {
return nil
}
func (w *influxDBWriter) initWriteClient() (c influxdb.Client, err error) {
func (w *influxDBWriter) initWriteClient() (influxdb.Client, error) {
if w.config.Protocol == "http" {
c, err = influxdb.NewHTTPClient(influxdb.HTTPConfig{
Addr: w.config.Address,
})
} else {
c, err = influxdb.NewUDPClient(influxdb.UDPConfig{
return influxdb.NewHTTPClient(influxdb.HTTPConfig{
Addr: w.config.Address,
})
}
return
return influxdb.NewUDPClient(influxdb.UDPConfig{
Addr: w.config.Address,
})
}
func (w *influxDBWriter) handleWriteError(c influxdb.Client, writeErr error) error {