Skip to content

Commit

Permalink
Addressed review comments on assignment of variable
Browse files Browse the repository at this point in the history
  • Loading branch information
hkadayam committed Mar 25, 2024
1 parent 8f19527 commit df9a4b2
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/proto/proto_mesg_factory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,16 +66,14 @@ static void log_every_nth(std::string const& addr, ::grpc::Status const& status,
static constexpr uint64_t every_nth_sec = 60;
std::string msg = addr + "-" + status.error_message();

uint64_t failed_count = 0;
uint64_t failed_count{1ul};
if (auto const it = t_errors.find(msg); it != t_errors.end()) {
if (get_elapsed_time_sec(it->second.second) > every_nth_sec) {
failed_count = 1;
it->second = std::pair(1ul, Clock::now()); // Reset
} else {
failed_count = ++(it->second.first);
}
} else {
failed_count = 1;
t_errors[msg] = std::pair(1ul, Clock::now());
}

Expand Down

0 comments on commit df9a4b2

Please sign in to comment.