Merge pull request #752 from unihorn/75

fix(server): dispatch SetClusterConfigCommand correctly
This commit is contained in:
Yicheng Qin 2014-04-22 14:55:17 -07:00
commit a563d82f95

View File

@ -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: case *JoinCommandV1, *RemoveCommandV1,
url, _ = ps.registry.PeerURL(leader) *JoinCommandV2, *RemoveCommandV2,
case *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)