diff --git a/src/lib/replication/service/raft_repl_service.cpp b/src/lib/replication/service/raft_repl_service.cpp index 8417b141c..c4aefe1ca 100644 --- a/src/lib/replication/service/raft_repl_service.cpp +++ b/src/lib/replication/service/raft_repl_service.cpp @@ -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); } diff --git a/src/lib/replication/service/raft_repl_service.h b/src/lib/replication/service/raft_repl_service.h index 4daaad9b3..e0d1e6718 100644 --- a/src/lib/replication/service/raft_repl_service.h +++ b/src/lib/replication/service/raft_repl_service.h @@ -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;