mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Make I/O and prefetch worker threads configurable
This commit is contained in:
committed by
Nik Bougalis
parent
6746b863b3
commit
cf97dcb992
@@ -655,6 +655,26 @@ Config::loadFromString(std::string const& fileContents)
|
||||
": must be between 1 and 1024 inclusive.");
|
||||
}
|
||||
|
||||
if (getSingleSection(secConfig, SECTION_IO_WORKERS, strTemp, j_))
|
||||
{
|
||||
IO_WORKERS = beast::lexicalCastThrow<int>(strTemp);
|
||||
|
||||
if (IO_WORKERS < 1 || IO_WORKERS > 1024)
|
||||
Throw<std::runtime_error>(
|
||||
"Invalid " SECTION_IO_WORKERS
|
||||
": must be between 1 and 1024 inclusive.");
|
||||
}
|
||||
|
||||
if (getSingleSection(secConfig, SECTION_PREFETCH_WORKERS, strTemp, j_))
|
||||
{
|
||||
PREFETCH_WORKERS = beast::lexicalCastThrow<int>(strTemp);
|
||||
|
||||
if (PREFETCH_WORKERS < 1 || PREFETCH_WORKERS > 1024)
|
||||
Throw<std::runtime_error>(
|
||||
"Invalid " SECTION_PREFETCH_WORKERS
|
||||
": must be between 1 and 1024 inclusive.");
|
||||
}
|
||||
|
||||
if (getSingleSection(secConfig, SECTION_COMPRESSION, strTemp, j_))
|
||||
COMPRESSION = beast::lexicalCastThrow<bool>(strTemp);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user