diff options
Diffstat (limited to 'src/server/database/Database/MySQLConnection.cpp')
-rw-r--r-- | src/server/database/Database/MySQLConnection.cpp | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/src/server/database/Database/MySQLConnection.cpp b/src/server/database/Database/MySQLConnection.cpp index 3383f9507ed..c42ca4e2903 100644 --- a/src/server/database/Database/MySQLConnection.cpp +++ b/src/server/database/Database/MySQLConnection.cpp @@ -47,23 +47,13 @@ MySQLConnectionInfo::MySQLConnectionInfo(std::string const& infoString) ssl.assign(tokens[5]); } -MySQLConnection::MySQLConnection(MySQLConnectionInfo& connInfo) : +MySQLConnection::MySQLConnection(MySQLConnectionInfo& connInfo, ConnectionFlags connectionFlags) : m_reconnecting(false), m_prepareError(false), -m_queue(nullptr), m_Mysql(nullptr), m_connectionInfo(connInfo), -m_connectionFlags(CONNECTION_SYNCH) { } - -MySQLConnection::MySQLConnection(ProducerConsumerQueue<SQLOperation*>* queue, MySQLConnectionInfo& connInfo) : -m_reconnecting(false), -m_prepareError(false), -m_queue(queue), -m_Mysql(nullptr), -m_connectionInfo(connInfo), -m_connectionFlags(CONNECTION_ASYNC) +m_connectionFlags(connectionFlags) { - m_worker = std::make_unique<DatabaseWorker>(m_queue, this); } MySQLConnection::~MySQLConnection() @@ -452,6 +442,11 @@ uint32 MySQLConnection::GetLastError() return mysql_errno(m_Mysql); } +void MySQLConnection::StartDatabaseWorkerThread(ProducerConsumerQueue<SQLOperation*>* queue) +{ + m_worker = std::make_unique<DatabaseWorker>(queue, this); +} + bool MySQLConnection::LockIfReady() { return m_Mutex.try_lock(); |