Core/Database: Refactor MySQLConnection constructors and async thread creation

This commit is contained in:
Shauren
2023-12-14 17:00:58 +01:00
parent 685ead8642
commit 5c59e2a248
11 changed files with 25 additions and 50 deletions
@@ -382,9 +382,13 @@ uint32 DatabaseWorkerPool<T>::OpenConnections(InternalIndex type, uint8 numConne
switch (type)
{
case IDX_ASYNC:
return std::make_unique<T>(_queue.get(), *_connectionInfo);
{
auto c = std::make_unique<T>(*_connectionInfo, CONNECTION_ASYNC);
c->StartDatabaseWorkerThread(_queue.get());
return c;
}
case IDX_SYNCH:
return std::make_unique<T>(*_connectionInfo);
return std::make_unique<T>(*_connectionInfo, CONNECTION_SYNCH);
default:
ABORT();
}