influxdb output: If all write fails, trigger a reconnect

closes #836
This commit is contained in:
Cameron Sparr 2016-03-14 10:28:01 +00:00 committed by Michele Fadda
parent 3923c02979
commit 34c4f4bf53
1 changed files with 6 additions and 0 deletions

View File

@ -191,6 +191,12 @@ func (i *InfluxDB) Write(metrics []telegraf.Metric) error {
break break
} }
} }
// If all of the writes failed, create a new connection array so that
// i.Connect() will be called on the next gather.
if err != nil {
i.conns = make([]client.Client)
}
return err return err
} }