ignore "-peers" option if cluster is already bootstrapped

This commit is contained in:
Chris Lu 2014-03-15 00:36:51 -07:00
parent 6cedaf4356
commit fb75fe852c

View file

@ -58,14 +58,13 @@ func NewRaftServer(r *mux.Router, version string, peers []string, httpAddr strin
if !s.raftServer.IsLogEmpty() {
glog.V(0).Infoln("Cannot join with an existing log")
} else {
if err := s.Join(s.peers); err != nil {
return nil
}
glog.V(0).Infoln("Joined cluster")
}
if err := s.Join(s.peers); err != nil {
return nil
}
glog.V(0).Infoln("Joined cluster")
// Initialize the server by joining itself.
} else if s.raftServer.IsLogEmpty() {
glog.V(0).Infoln("Initializing new cluster")