InfluxDB: Flush only if there's data in the buffer

Regression from 2.10.4
This commit is contained in:
Michael Friedrich 2019-03-27 11:16:08 +01:00
parent 09dfdaa71b
commit cb3729bc6a
1 changed files with 4 additions and 4 deletions

View File

@ -421,10 +421,6 @@ void InfluxdbWriter::FlushTimeoutWQ()
{
AssertOnWorkQueue();
// Flush if there are any data available
if (m_DataBuffer.empty())
return;
Log(LogDebug, "InfluxdbWriter")
<< "Timer expired writing " << m_DataBuffer.size() << " data points";
@ -433,6 +429,10 @@ void InfluxdbWriter::FlushTimeoutWQ()
void InfluxdbWriter::Flush()
{
/* Flush can be called from 1) Timeout 2) Threshold 3) on shutdown/reload. */
if (m_DataBuffer.empty())
return;
Log(LogDebug, "InfluxdbWriter")
<< "Flushing data buffer to InfluxDB.";