Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make example a tiny bit more general #78

Merged
merged 3 commits into from
Jun 29, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/single_mem_node/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ fn on_ready(r: &mut RawNode<MemStorage>, cbs: &mut HashMap<u8, ProposeCallback>)
// The Raft is ready, we can do something now.
let mut ready = r.ready();

let is_leader = r.raft.leader_id == 1;
let is_leader = r.raft.leader_id == r.raft.id;
if is_leader {
// If the peer is leader, the leader can send messages to other followers ASAP.
let msgs = ready.messages.drain(..);
Expand Down