Skip to content

Commit

Permalink
Merge pull request #9810 from Icinga/Al2Klimov-patch-8
Browse files Browse the repository at this point in the history
ElasticsearchWriter#Pause(): call Flush() only once
  • Loading branch information
julianbrost committed Jun 30, 2023
2 parents fdaa96e + 076eb59 commit 70d6b6e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/perfdata/elasticsearchwriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.";
Expand Down

0 comments on commit 70d6b6e

Please sign in to comment.