Browse Source

simplify isLeader() logic

pull/858/head
Chris Lu 6 years ago
parent
commit
ad257ae179
  1. 3
      weed/topology/topology.go

3
weed/topology/topology.go

@ -53,9 +53,6 @@ func (t *Topology) IsLeader() bool {
if t.RaftServer!=nil { if t.RaftServer!=nil {
return t.RaftServer.State() == raft.Leader return t.RaftServer.State() == raft.Leader
} }
if leader, e := t.Leader(); e == nil {
return leader == t.RaftServer.Name()
}
return false return false
} }

Loading…
Cancel
Save