Skip to content

Commit

Permalink
fix: Fixing microsecond precision constant for v1
Browse files Browse the repository at this point in the history
  • Loading branch information
vlastahajek committed Apr 16, 2020
1 parent 5d0d49c commit 236d79d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/InfluxDbClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ static String escapeKey(String key);
static String escapeValue(const char *value);
static String escapeJSONString(String &value);

static String precisionToString(WritePrecision precision) {
static String precisionToString(WritePrecision precision, uint8_t version = 2) {
switch(precision) {
case WritePrecision::US:
return "us";
return version==1?"u":"us";
case WritePrecision::MS:
return "ms";
case WritePrecision::NS:
Expand Down Expand Up @@ -266,7 +266,7 @@ void InfluxDBClient::setUrls() {
}
}
if(_writePrecision != WritePrecision::NoTime) {
_writeUrl += String("&precision=") + precisionToString(_writePrecision);
_writeUrl += String("&precision=") + precisionToString(_writePrecision, _dbVersion);
}

}
Expand Down

0 comments on commit 236d79d

Please sign in to comment.