Fix limititing number of retries

This commit is contained in:
Thomas Kopp 2019-02-02 14:59:00 +01:00
parent 94550e1743
commit 1ea0ea410d

View file

@ -4,7 +4,6 @@ void pushToInfluxDB(String device, float sensorValues[]) {
uint8_t tries = 0; uint8_t tries = 0;
boolean addComma = false; boolean addComma = false;
tries++;
String msg = "weather,device=" + device + " "; String msg = "weather,device=" + device + " ";
if (!(isnan(sensorValues[SENSOR_TEMPERATURE]))) if (!(isnan(sensorValues[SENSOR_TEMPERATURE])))
{ {
@ -66,6 +65,7 @@ void pushToInfluxDB(String device, float sensorValues[]) {
#endif #endif
do { do {
tries++;
influxdb.write(msg); influxdb.write(msg);
} while (influxdb.response() != DB_SUCCESS and tries < 5); } while (influxdb.response() != DB_SUCCESS and tries < 5);
} }