correct worker threads amounts

pull/686/head
Jeff 5 years ago
parent 6882e627ba
commit b9cdfd116e

@ -94,9 +94,13 @@ namespace llarp
m_addrInfo.port = p;
m_publicOverride = true;
}
if(key == "worker-threads")
if(key == "worker-threads" || key == "threads")
{
m_workerThreads = atoi(std::string(val).c_str());
if(m_workerThreads <= 0)
{
m_workerThreads = 1;
}
}
if(key == "net-threads")
{

@ -125,8 +125,8 @@ namespace llarp
struct sockaddr_in m_ip4addr;
AddressInfo m_addrInfo;
int m_workerThreads;
int m_numNetThreads;
int m_workerThreads = 1;
int m_numNetThreads = 1;
public:
// clang-format off

@ -58,9 +58,10 @@ namespace llarp
{
SetPIDFile(config->system.pidfile);
}
worker = std::make_shared< llarp::thread::ThreadPool >(
config->router.workerThreads(), 1024, "llarp-worker");
auto threads = config.router.workerThreads();
if(threads <= 0)
threads = 1;
worker = std::make_shared< llarp::thread::ThreadPool >(threads, 1024, "llarp-worker");
nodedb_dir = config->netdb.nodedbDir();

Loading…
Cancel
Save