fix darwin build

This commit is contained in:
Sergei Trifonov 2022-08-18 19:30:33 +02:00
parent 806df20d18
commit 7bbbe0a4db

View File

@ -1160,14 +1160,14 @@ int Server::main(const std::vector<std::string> & /*args*/)
if (config->has("concurrent_threads_soft_limit_num"))
{
auto value = config->getUInt64("concurrent_threads_soft_limit_num", 0);
if (value > 0)
concurrent_threads_soft_limit = std::min(concurrent_threads_soft_limit, value);
if (value > 0 && value < concurrent_threads_soft_limit)
concurrent_threads_soft_limit = value;
}
if (config->has("concurrent_threads_soft_limit_ratio_to_cores"))
{
auto value = config->getUInt64("concurrent_threads_soft_limit_ratio_to_cores", 0) * std::thread::hardware_concurrency();
if (value > 0)
concurrent_threads_soft_limit = std::min(concurrent_threads_soft_limit, value);
if (value > 0 && value < concurrent_threads_soft_limit)
concurrent_threads_soft_limit = value;
}
ConcurrencyControl::instance().setMaxConcurrency(concurrent_threads_soft_limit);