Fix some configs being overriden with 0 (#2251)

This commit is contained in:
Guilherme Lawless 2019-08-26 07:54:13 +01:00 committed by GitHub
commit f8f06a231b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 4 deletions

View file

@ -135,9 +135,9 @@ nano::error nano::logging::deserialize_toml (nano::tomlconfig & toml)
toml.get<bool> ("single_line_record", single_line_record_value);
toml.get<uintmax_t> ("max_size", max_size);
toml.get<uintmax_t> ("rotation_size", rotation_size);
uintmax_t min_time_between_log_output_raw;
toml.get<uintmax_t> ("min_time_between_output", min_time_between_log_output_raw);
min_time_between_log_output = std::chrono::milliseconds (min_time_between_log_output_raw);
auto min_time_between_log_output_l = min_time_between_log_output.count ();
toml.get ("min_time_between_output", min_time_between_log_output_l);
min_time_between_log_output = std::chrono::milliseconds (min_time_between_log_output_l);
return toml.get_error ();
}

View file

@ -269,8 +269,10 @@ nano::error nano::node_config::deserialize_toml (nano::tomlconfig & toml)
toml.get<unsigned> ("vote_generator_threshold", vote_generator_threshold);
auto block_processor_batch_max_time_l (toml.get<unsigned long> ("block_processor_batch_max_time"));
auto block_processor_batch_max_time_l = block_processor_batch_max_time.count ();
toml.get ("block_processor_batch_max_time", block_processor_batch_max_time_l);
block_processor_batch_max_time = std::chrono::milliseconds (block_processor_batch_max_time_l);
auto unchecked_cutoff_time_l = static_cast<unsigned long> (unchecked_cutoff_time.count ());
toml.get ("unchecked_cutoff_time", unchecked_cutoff_time_l);
unchecked_cutoff_time = std::chrono::seconds (unchecked_cutoff_time_l);