Skip to content

Commit

Permalink
Adding support for single-node clusters
Browse files Browse the repository at this point in the history
  • Loading branch information
andreev-io committed Nov 19, 2021
1 parent 00704a6 commit f5e7a15
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions little_raft/src/replica.rs
Original file line number Diff line number Diff line change
Expand Up @@ -703,5 +703,9 @@ where
last_log_index: self.log.len() - 1,
last_log_term: self.log[self.log.len() - 1].term,
});

if self.peer_ids.len() == 0 {
self.become_leader();
}
}
}

0 comments on commit f5e7a15

Please sign in to comment.