Skip to content

Commit

Permalink
chore: apply suggestion
Browse files Browse the repository at this point in the history
Co-authored-by: Jeremyhi <[email protected]>
  • Loading branch information
killme2008 and fengjiachun authored Apr 30, 2024
1 parent 86ab3d9 commit 7b9922c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/meta-srv/src/service/cluster.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ impl cluster_server::Cluster for Metasrv {

impl Metasrv {
pub fn is_leader(&self) -> bool {
// Returns true when using memory backend.
// Returns true when there is no `election`, indicating the presence of only one `Metasrv` node, which is the leader.
self.election().map(|x| x.is_leader()).unwrap_or(true)
}
}

0 comments on commit 7b9922c

Please sign in to comment.