Skip to content

Commit

Permalink
Make example a tiny bit more general (#78)
Browse files Browse the repository at this point in the history
  • Loading branch information
matklad authored and A. Hobden committed Jun 29, 2018
1 parent fb292a7 commit b8d746a
Showing 1 changed file with 1 addition and 1 deletion.
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

0 comments on commit b8d746a

Please sign in to comment.