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
parent db8c24cc7b
commit 8c6c144f28
1 changed files with 6 additions and 0 deletions

View File

@ -191,6 +191,12 @@ func (i *InfluxDB) Write(metrics []telegraf.Metric) error {
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
}