Skip to content

Commit

Permalink
Merge pull request #19 from andreev-io/ilya/single-node-cluster-support
Browse files Browse the repository at this point in the history
  • Loading branch information
andreev-io authored Nov 20, 2021
2 parents bd3d7bb + f5e7a15 commit b6aef26
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 b6aef26

Please sign in to comment.