mirror of
https://github.com/scylladb/scylladb.git
synced 2026-05-29 19:21:01 +00:00
raft: use existing function to check if election timeout elapsed
is_past_election_timeout() repeats the calculation that election_elapsed() is doing. Use existing function instead.
This commit is contained in:
@@ -224,7 +224,7 @@ private:
|
||||
void maybe_commit();
|
||||
// Check if the randomized election timeout has expired.
|
||||
bool is_past_election_timeout() const {
|
||||
return _clock.now() - _last_election_time >= _randomized_election_timeout;
|
||||
return election_elapsed() >= _randomized_election_timeout;
|
||||
}
|
||||
|
||||
// A helper to send any kind of RPC message.
|
||||
|
||||
Reference in New Issue
Block a user