Explorar o código

etcd: do not generate id if next state is stop

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

+ 3 - 1
etcd/etcd.go

@@ -215,7 +215,9 @@ func (s *Server) Run() error {
 		default:
 			panic("unsupport mode")
 		}
-		s.id = genId()
+		if next != stopMode {
+			s.id = genId()
+		}
 	}
 }