Skip to content

Commit

Permalink
fix nit
Browse files Browse the repository at this point in the history
  • Loading branch information
yuwmao committed Oct 16, 2024
1 parent d35f75e commit f88317d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/lib/replication/service/raft_repl_service.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,8 @@ void RaftReplService::restart_raft_svc(const std::string filepath, const bool de
}

bool RaftReplService::wait_for_cert(const std::string& filepath) {
for (auto i = cert_change_timeout; i > 0; --i) {
auto attempts = cert_change_timeout/cert_check_sleep;
for (auto i = attempts; i > 0; --i) {
if (std::filesystem::exists(filepath)) { return true; }
std::this_thread::sleep_for(cert_check_sleep);
}
Expand Down
2 changes: 1 addition & 1 deletion src/lib/replication/service/raft_repl_service.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

namespace homestore {

constexpr auto cert_change_timeout = 1200;
constexpr auto cert_change_timeout = std::chrono::seconds(1200);
constexpr auto cert_check_sleep = std::chrono::seconds(1);

struct repl_dev_superblk;
Expand Down

0 comments on commit f88317d

Please sign in to comment.