Log sync db queries in World::Update() loop (#25174)

* Core/Misc: Log sync queries on critical path

* Fix build

* Rename

* Fix warning

* Fix no-pch

* Change WarnAboutSyncQueries() to be header-only

(cherry picked from commit deceb11b5f)
This commit is contained in:
Giacomo Pozzoni
2020-07-30 19:42:27 +00:00
committed by Shauren
parent 6d9a084036
commit 736b9ac112
4 changed files with 39 additions and 0 deletions

View File

@@ -481,6 +481,11 @@ void WorldUpdateLoop()
uint32 realCurrTime = 0;
uint32 realPrevTime = getMSTime();
LoginDatabase.WarnAboutSyncQueries(true);
CharacterDatabase.WarnAboutSyncQueries(true);
WorldDatabase.WarnAboutSyncQueries(true);
HotfixDatabase.WarnAboutSyncQueries(true);
///- While we have not World::m_stopEvent, update the world
while (!World::IsStopped())
{
@@ -506,6 +511,11 @@ void WorldUpdateLoop()
Sleep(1000);
#endif
}
LoginDatabase.WarnAboutSyncQueries(false);
CharacterDatabase.WarnAboutSyncQueries(false);
WorldDatabase.WarnAboutSyncQueries(false);
HotfixDatabase.WarnAboutSyncQueries(false);
}
void SignalHandler(boost::system::error_code const& error, int /*signalNumber*/)