Modify the number of event loops in the DbClientImpl class

This commit is contained in:
an-tao 2019-02-18 11:10:30 +08:00
parent 13417edf10
commit 1600cb98fe
1 changed files with 1 additions and 1 deletions

View File

@ -44,7 +44,7 @@ using namespace drogon::orm;
DbClientImpl::DbClientImpl(const std::string &connInfo, const size_t connNum, ClientType type)
: _connInfo(connInfo),
_connectNum(connNum),
_loops(type == ClientType::Sqlite3 ? 1 : (connNum / 100 > 0 ? connNum / 100 : 1), "DbLoop")
_loops(type == ClientType::Sqlite3 ? 1 : (connNum < std::thread::hardware_concurrency() ? connNum : std::thread::hardware_concurrency()), "DbLoop")
{
_type = type;
LOG_TRACE << "type=" << (int)type;