Skip to content

Commit

Permalink
Correct node name in /v1/leader-redirect-by-node-name/
Browse files Browse the repository at this point in the history
  • Loading branch information
tailhook committed Apr 23, 2018
1 parent 3b77c54 commit 10ca149
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/daemon/frontend/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -419,13 +419,13 @@ pub fn serve<S: 'static>(state: &SharedState, route: &ApiRoute, format: Format)
let peers = state.peers();
let election = state.election();
if election.is_leader {
Ok(Break(Some(state.hostname.clone())))
Ok(Break(Some(state.name.clone())))
} else {
match election.leader.as_ref()
.and_then(|id| peers.peers.get(id))
{
Some(peer) => {
Ok(Break(Some(peer.get().hostname.clone())))
Ok(Break(Some(peer.get().name.clone())))
}
None => {
if iter > 65 {
Expand Down

0 comments on commit 10ca149

Please sign in to comment.