[9517] rewrote RA console using ACE

- moved SQL pinging to SqlDelayThread
- use sAccountMgr instead of explict sql queries
This commit is contained in:
arrai 2010-03-01 23:27:05 +01:00
parent bc5092686e
commit 39559fc73a
8 changed files with 307 additions and 179 deletions

View file

@ -30,17 +30,28 @@ void SqlDelayThread::run()
mysql_thread_init();
#endif
const uint32 loopSleepms = 10;
const uint32 pingEveryLoop = m_dbEngine->GetPingIntervall()/loopSleepms;
uint32 loopCounter = 0;
while (m_running)
{
// if the running state gets turned off while sleeping
// empty the queue before exiting
ACE_Based::Thread::Sleep(10);
ACE_Based::Thread::Sleep(loopSleepms);
SqlOperation* s;
while (m_sqlQueue.next(s))
{
s->Execute(m_dbEngine);
delete s;
}
if((loopCounter++) >= pingEveryLoop)
{
loopCounter = 0;
delete m_dbEngine->Query("SELECT 1");
}
}
#ifndef DO_POSTGRESQL