Merge pull request #16217 from Atlante45/fix/flush-timer

BUGZ-489: Make sure the flush timer is not spawned too early
This commit is contained in:
Shannon Romano 2019-09-20 12:35:39 -07:00 committed by GitHub
commit 22dffa5ce8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 12 additions and 12 deletions

View file

@ -240,6 +240,9 @@ AssignmentClientApp::AssignmentClientApp(int argc, char* argv[]) :
QThread::currentThread()->setObjectName("main thread");
LogHandler::getInstance().setParent(this);
LogHandler::getInstance().setupRepeatedMessageFlusher();
DependencyManager::registerInheritance<LimitedNodeList, NodeList>();
DependencyManager::set<ScriptInitializers>();

View file

@ -174,6 +174,9 @@ DomainServer::DomainServer(int argc, char* argv[]) :
LogUtils::init();
LogHandler::getInstance().setParent(this);
LogHandler::getInstance().setupRepeatedMessageFlusher();
qDebug() << "Setting up domain-server";
qDebug() << "[VERSION] Build sequence:" << qPrintable(applicationVersion());
qDebug() << "[VERSION] MODIFIED_ORGANIZATION:" << BuildInfo::MODIFIED_ORGANIZATION;
@ -320,7 +323,7 @@ DomainServer::DomainServer(int argc, char* argv[]) :
connect(_contentManager.get(), &DomainContentBackupManager::recoveryCompleted, this, &DomainServer::restart);
static const int NODE_PING_MONITOR_INTERVAL_MSECS = 1 * MSECS_PER_SECOND;
static const int NODE_PING_MONITOR_INTERVAL_MSECS = 1 * MSECS_PER_SECOND;
_nodePingMonitorTimer = new QTimer{ this };
connect(_nodePingMonitorTimer, &QTimer::timeout, this, &DomainServer::nodePingMonitor);
_nodePingMonitorTimer->start(NODE_PING_MONITOR_INTERVAL_MSECS);

View file

@ -1060,6 +1060,9 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
setProperty(hifi::properties::STEAM, (steamClient && steamClient->isRunning()));
setProperty(hifi::properties::CRASHED, _previousSessionCrashed);
LogHandler::getInstance().setParent(this);
LogHandler::getInstance().setupRepeatedMessageFlusher();
{
const QStringList args = arguments();

View file

@ -32,14 +32,6 @@ LogHandler& LogHandler::getInstance() {
return staticInstance;
}
LogHandler::LogHandler() {
// make sure we setup the repeated message flusher, but do it on the LogHandler thread
QMetaObject::invokeMethod(this, "setupRepeatedMessageFlusher");
}
LogHandler::~LogHandler() {
}
const char* stringForLogType(LogMsgType msgType) {
switch (msgType) {
case LogInfo:

View file

@ -54,12 +54,11 @@ public:
int newRepeatedMessageID();
void printRepeatedMessage(int messageID, LogMsgType type, const QMessageLogContext& context, const QString &message);
private slots:
void setupRepeatedMessageFlusher();
private:
LogHandler();
~LogHandler();
LogHandler() = default;
~LogHandler() = default;
void flushRepeatedMessages();