Skip to content

Commit

Permalink
Polish
Browse files Browse the repository at this point in the history
  • Loading branch information
resetius committed Nov 28, 2023
1 parent 6f3aa60 commit 57ce5cd
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/raft.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,7 @@ std::unique_ptr<TResult> TRaft::Leader(ITimeSource::Time now, TMessageHolder<TMe
}

void TRaft::Become(EState newStateName) {
// TODO: unused function
if (StateName != newStateName) {
StateName = newStateName;
if (StateName == EState::LEADER) {
Expand Down Expand Up @@ -456,7 +457,9 @@ void TRaft::ApplyResult(ITimeSource::Time now, std::unique_ptr<TResult> result,
StateName = result->NextStateName;
}

ProcessWaiting();
if (StateName == EState::LEADER) {
ProcessWaiting();
}
}

void TRaft::ProcessWaiting() {
Expand Down

0 comments on commit 57ce5cd

Please sign in to comment.