Make maxLogSize configurable

This commit is contained in:
Eelco Dolstra 2017-09-22 15:23:58 +02:00
parent d9cbf8cf01
commit 27103398c9
No known key found for this signature in database
GPG key ID: 8170B4726D7198DE
3 changed files with 3 additions and 1 deletions

View file

@ -266,7 +266,7 @@ void State::buildRemote(ref<Store> destStore,
to << cmdBuildDerivation << step->drvPath << basicDrv; to << cmdBuildDerivation << step->drvPath << basicDrv;
to << maxSilentTime << buildTimeout; to << maxSilentTime << buildTimeout;
if (GET_PROTOCOL_MINOR(remoteVersion) >= 2) if (GET_PROTOCOL_MINOR(remoteVersion) >= 2)
to << 64 * 1024 * 1024; // == maxLogSize to << maxLogSize;
if (GET_PROTOCOL_MINOR(remoteVersion) >= 3) { if (GET_PROTOCOL_MINOR(remoteVersion) >= 3) {
to << repeats // == build-repeat to << repeats // == build-repeat
<< step->isDeterministic; // == enforce-determinism << step->isDeterministic; // == enforce-determinism

View file

@ -85,6 +85,7 @@ State::State()
, dbPool(config->getIntOption("max_db_connections", 128)) , dbPool(config->getIntOption("max_db_connections", 128))
, memoryTokens(config->getIntOption("nar_buffer_size", getMemSize() / 2)) , memoryTokens(config->getIntOption("nar_buffer_size", getMemSize() / 2))
, maxOutputSize(config->getIntOption("max_output_size", 2ULL << 30)) , maxOutputSize(config->getIntOption("max_output_size", 2ULL << 30))
, maxLogSize(config->getIntOption("max_log_size", 64ULL << 20))
, uploadLogsToBinaryCache(config->getBoolOption("upload_logs_to_binary_cache", false)) , uploadLogsToBinaryCache(config->getBoolOption("upload_logs_to_binary_cache", false))
{ {
debug("using %d bytes for the NAR buffer", memoryTokens.capacity()); debug("using %d bytes for the NAR buffer", memoryTokens.capacity());

View file

@ -420,6 +420,7 @@ private:
nix::TokenServer memoryTokens; nix::TokenServer memoryTokens;
size_t maxOutputSize; size_t maxOutputSize;
size_t maxLogSize;
time_t lastStatusLogged = 0; time_t lastStatusLogged = 0;
const int statusLogInterval = 300; const int statusLogInterval = 300;