Explorar o código

fix a bug when compare cluster len

Xiang Li %!s(int64=12) %!d(string=hai) anos
pai
achega
f470702b88
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      etcd.go

+ 1 - 1
etcd.go

@@ -223,7 +223,7 @@ func startRaft(securityType int) {
 	if raftServer.IsLogEmpty() {
 
 		// start as a leader in a new cluster
-		if len(cluster) == 1 && cluster[0] == "" {
+		if len(cluster) == 0 {
 			raftServer.StartLeader()
 
 			time.Sleep(time.Millisecond * 20)