Browse Source

fix(server): dispatch SetClusterConfigCommand correctly

Yicheng Qin 11 years ago
parent
commit
c7116a37c0
1 changed files with 3 additions and 3 deletions
  1. 3 3
      server/server.go

+ 3 - 3
server/server.go

@@ -276,9 +276,9 @@ func (s *Server) Dispatch(c raft.Command, w http.ResponseWriter, req *http.Reque
 
 
 	var url string
 	var url string
 	switch c.(type) {
 	switch c.(type) {
-	case *JoinCommandV1, *RemoveCommandV1:
-		url, _ = ps.registry.PeerURL(leader)
-	case *JoinCommandV2, *RemoveCommandV2:
+	case *JoinCommandV1, *RemoveCommandV1,
+		*JoinCommandV2, *RemoveCommandV2,
+		*SetClusterConfigCommand:
 		url, _ = ps.registry.PeerURL(leader)
 		url, _ = ps.registry.PeerURL(leader)
 	default:
 	default:
 		url, _ = ps.registry.ClientURL(leader)
 		url, _ = ps.registry.ClientURL(leader)