Merge pull request #7130 from Icinga/bugfix/logrotate-issues-6737

StreamLogger#BindStream(): set #m_FlushLogTimer only if needed
This commit is contained in:
Michael Friedrich 2019-04-24 11:49:33 +02:00 committed by GitHub
commit f747e6b405
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 4 deletions

View File

@ -55,10 +55,12 @@ void StreamLogger::BindStream(std::ostream *stream, bool ownsStream)
m_Stream = stream;
m_OwnsStream = ownsStream;
m_FlushLogTimer = new Timer();
m_FlushLogTimer->SetInterval(1);
m_FlushLogTimer->OnTimerExpired.connect(std::bind(&StreamLogger::FlushLogTimerHandler, this));
m_FlushLogTimer->Start();
if (!m_FlushLogTimer) {
m_FlushLogTimer = new Timer();
m_FlushLogTimer->SetInterval(1);
m_FlushLogTimer->OnTimerExpired.connect(std::bind(&StreamLogger::FlushLogTimerHandler, this));
m_FlushLogTimer->Start();
}
}
/**