Merge pull request #9810 from Icinga/Al2Klimov-patch-8

ElasticsearchWriter#Pause(): call Flush() only once
This commit is contained in:
Julian Brost 2023-06-30 17:21:16 +02:00 committed by GitHub
commit 70d6b6e424
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 3 deletions

View File

@ -118,10 +118,12 @@ void ElasticsearchWriter::Pause()
m_HandleNotifications.disconnect();
m_FlushTimer->Stop(true);
Flush();
m_WorkQueue.Join();
Flush();
{
std::unique_lock<std::mutex> lock (m_DataBufferMutex);
Flush();
}
Log(LogInformation, "ElasticsearchWriter")
<< "'" << GetName() << "' paused.";