diff options
Diffstat (limited to 'src/server/authserver/Main.cpp')
-rw-r--r-- | src/server/authserver/Main.cpp | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/server/authserver/Main.cpp b/src/server/authserver/Main.cpp index d23aecf3313..f92949aadc5 100644 --- a/src/server/authserver/Main.cpp +++ b/src/server/authserver/Main.cpp @@ -339,15 +339,22 @@ bool StartDB() return false; } - uint8 num_threads = sConfig.GetIntDefault("LoginDatabase.WorkerThreads", 1); - if (num_threads < 1 || num_threads > 32) + uint8 worker_threads = sConfig.GetIntDefault("LoginDatabase.WorkerThreads", 1); + if (worker_threads < 1 || worker_threads > 32) { sLog.outError("Improper value specified for LoginDatabase.WorkerThreads, defaulting to 1."); - num_threads = 1; + worker_threads = 1; } - //- Authserver has singlethreaded synchronous DB access, hence MYSQL_BUNDLE_ALL - if (!LoginDatabase.Open(dbstring.c_str(), num_threads, MYSQL_BUNDLE_ALL)) + uint8 synch_threads = sConfig.GetIntDefault("LoginDatabase.SynchThreads", 1); + if (synch_threads < 1 || synch_threads > 32) + { + sLog.outError("Improper value specified for LoginDatabase.SynchThreads, defaulting to 1."); + synch_threads = 1; + } + + /// NOTE: While authserver is singlethreaded you should keep synch_threads == 1. Increasing it is just silly since only 1 will be used ever. + if (!LoginDatabase.Open(dbstring.c_str(), worker_threads, synch_threads)) { sLog.outError("Cannot connect to database"); return false; |