fortuna: add seed_file_manager_service() [wip]
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
cc26b654d4
commit
06db22bfa4
16
fortuna.cpp
16
fortuna.cpp
|
@ -20,9 +20,11 @@ namespace fortuna {
|
||||||
fmt::print(stderr, "{}\n", e.what());
|
fmt::print(stderr, "{}\n", e.what());
|
||||||
}
|
}
|
||||||
th_gen = std::thread(generator_service, &R.Gen);
|
th_gen = std::thread(generator_service, &R.Gen);
|
||||||
|
th_sfm = std::thread(seed_file_manager_service);
|
||||||
}
|
}
|
||||||
Fortuna::~Fortuna() noexcept {
|
Fortuna::~Fortuna() noexcept {
|
||||||
th_gen.join();
|
th_gen.join();
|
||||||
|
th_sfm.join();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -93,6 +95,20 @@ namespace fortuna {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
auto Fortuna::seed_file_manager_service() -> void {
|
||||||
|
// TODO(me): implement proper logic, i.e. include SeedFileManager
|
||||||
|
fmt::print("[i] fortuna: starting seed file manager service\n");
|
||||||
|
// FIXME: proper interval is 10 minutes
|
||||||
|
uint interval{1}; // in seconds
|
||||||
|
auto now{fortuna::Util::current_time()};
|
||||||
|
|
||||||
|
while(true) {
|
||||||
|
now = fortuna::Util::current_time();
|
||||||
|
fmt::print("[*] sfm: hello now @{}\n", now);
|
||||||
|
std::this_thread::sleep_until(now + std::chrono::seconds(interval));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace fortuna
|
} // namespace fortuna
|
||||||
|
|
||||||
#endif//FORTUNA_FORTUNA_CPP
|
#endif//FORTUNA_FORTUNA_CPP
|
||||||
|
|
Reference in New Issue