File tree Expand file tree Collapse file tree 1 file changed +2
-8
lines changed
Expand file tree Collapse file tree 1 file changed +2
-8
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,6 @@ type DefaultClusterSelector struct {
99 clusterGroup motan.ClusterGroup
1010 defaultSandboxCluster motan.Cluster
1111 defaultGreyCluster motan.Cluster
12- greyClusterMap map [string ]motan.Cluster
1312}
1413
1514func (d * DefaultClusterSelector ) Init (clusterGroup motan.ClusterGroup ) {
@@ -19,11 +18,6 @@ func (d *DefaultClusterSelector) Init(clusterGroup motan.ClusterGroup) {
1918 }
2019 if len (clusterGroup .GetGreyClusters ()) > 0 {
2120 d .defaultGreyCluster = clusterGroup .GetGreyClusters ()[0 ]
22- greyClusterMap := make (map [string ]motan.Cluster )
23- for _ , cluster := range clusterGroup .GetGreyClusters () {
24- greyClusterMap [cluster .GetURL ().Group ] = cluster
25- }
26- d .greyClusterMap = greyClusterMap
2721 }
2822}
2923
@@ -68,8 +62,8 @@ func (d *DefaultClusterSelector) selectGreyCluster(request motan.Request) motan.
6862 }
6963 routeGroupList := motan .TrimSplit (routeGroup , "," )
7064 for _ , group := range routeGroupList {
71- if cluster , ok := d .greyClusterMap [ group ]; ok && len ( cluster . GetRefers ()) > 0 {
72- return cluster
65+ if group == d .defaultGreyCluster . GetURL (). Group {
66+ return d . defaultGreyCluster
7367 }
7468 }
7569 }
You can’t perform that action at this time.
0 commit comments