Change the freeze detector thread to be a periodic callback running on the thread pool

This commit is contained in:
leak
2014-07-06 23:04:38 +02:00
parent 32f5286d05
commit 59c8ffe4b3
2 changed files with 28 additions and 23 deletions

View File

@@ -137,7 +137,7 @@ int main(int argc, char** argv)
// Enabled a timed callback for handling the database keep alive ping
_dbPingInterval = sConfigMgr->GetIntDefault("MaxPingTime", 30);
_dbPingTimer.expires_from_now(boost::posix_time::seconds(_dbPingInterval));
_dbPingTimer.expires_from_now(boost::posix_time::minutes(_dbPingInterval));
_dbPingTimer.async_wait(KeepDatabaseAliveHandler);
// Start the io service worker loop
@@ -218,6 +218,7 @@ void KeepDatabaseAliveHandler(const boost::system::error_code& error)
LoginDatabase.KeepAlive();
_dbPingTimer.expires_from_now(boost::posix_time::minutes(_dbPingInterval));
_dbPingTimer.async_wait(KeepDatabaseAliveHandler);
}
}