mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
simplify a bit
This commit is contained in:
parent
a3411dd9da
commit
fba1cfc2d6
|
@ -118,15 +118,7 @@ func NewRaftServer(option *RaftServerOption) (*RaftServer, error) {
|
|||
|
||||
// Remove deleted peers
|
||||
for existsPeerName := range s.raftServer.Peers() {
|
||||
exists := false
|
||||
var existingPeer pb.ServerAddress
|
||||
for name, peer := range s.peers {
|
||||
if name == existsPeerName {
|
||||
exists, existingPeer = true, peer
|
||||
break
|
||||
}
|
||||
}
|
||||
if !exists {
|
||||
if existingPeer, found := s.peers[existsPeerName]; !found {
|
||||
if err := s.raftServer.RemovePeer(existsPeerName); err != nil {
|
||||
glog.V(0).Infoln(err)
|
||||
return nil, err
|
||||
|
|
Loading…
Reference in a new issue