sfm: assert checkup_interval < seed_write_interval
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
surtur 2022-01-23 20:27:14 +01:00
parent 8b9fbe1e1e
commit f48927738d
Signed by: wanderer
GPG Key ID: 19CE1EC1D9E0486D
2 changed files with 4 additions and 3 deletions

View File

@ -112,7 +112,7 @@ auto Fortuna::random_data(unsigned int n_bytes) -> void {
auto Fortuna::seed_file_manager_service() -> void {
static constexpr const std::chrono::seconds checkup_interval{10};
static constexpr const std::chrono::seconds checkup_interval{7};
{
std::lock_guard<std::mutex> p_ul(print_mtx);
@ -127,6 +127,7 @@ auto Fortuna::seed_file_manager_service() -> void {
assert(this->_p_accumulator->_p_pools_equal(this->R._p_pools));
SeedFileManager sfm(this->_p_accumulator);
assert(checkup_interval < sfm.get_write_interval());
a_ul.unlock();
mtx_l.unlock();

View File

@ -15,8 +15,8 @@ class SeedFileManager {
public:
struct conf {
// std::chrono::minutes write_interval{10};
// 10 minutes (as the standard recommends) is a lot, go with 120s
const std::chrono::seconds write_interval{120};
// 10 minutes (as the standard recommends) is a lot, go with 10s
const std::chrono::seconds write_interval{10};
std::string seed_f_path{"./.fortuna.seed"};
std::size_t seed_f_length{64};