Permalink
Browse files

Only allow the launch of the logserver once every 5s

The way it was before, I actually saw cases were several were being launched
during the 5th second.
  • Loading branch information...
Beirdo committed Jul 1, 2012
1 parent d553247 commit d92b6d4543bdf173a7f8714c23ea92786e6a7e93
Showing with 10 additions and 1 deletion.
  1. +10 −1 mythtv/libs/libmythbase/logging.cpp
@@ -449,14 +449,23 @@ void LoggerThread::initialTimeout(void)
/// heard from for at least 5s, restart it
void LoggerThread::checkHeartBeat(void)
{
+ static bool launched = false;
qlonglong epoch;
loggingGetTimeStamp(&epoch, NULL);
qlonglong age = (epoch - m_epoch) % 30;
if (age == 5)
{
- launchLogServer();
+ if (!launched)
+ {
+ launchLogServer();
+ launched = true;
+ }
+ }
+ else
+ {
+ launched = false;
}
}

0 comments on commit d92b6d4

Please sign in to comment.