liubao68 commented on a change in pull request #1376: ServerListFilterExt add
switch
URL:
https://github.com/apache/servicecomb-java-chassis/pull/1376#discussion_r345595492
##########
File path:
handlers/handler-loadbalance/src/main/java/org/apache/servicecomb/loadbalance/LoadBalancer.java
##########
@@ -58,7 +58,9 @@ public ServiceCombServer chooseServer(Invocation invocation)
{
List<ServiceCombServer> servers =
invocation.getLocalContext(LoadbalanceHandler.CONTEXT_KEY_SERVER_LIST);
int serversCount = servers.size();
for (ServerListFilterExt filterExt : filters) {
- servers = filterExt.getFilteredListOfServers(servers, invocation);
+ if(filterExt.enabled()) {
Review comment:
```
if(filterExt.enabled){continue;}
xxxx
```
This is better, or logs is not corret when servers is empty.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services