优化代码,去掉无用代码

pull/32/head
bruceppeng 3 years ago
parent e7c678c086
commit 406364feb6

@ -71,9 +71,7 @@ public class DynamicRouteScgFilter implements WebFilter, Ordered {
//Check whether the route has been loaded //Check whether the route has been loaded
for(RouteDefinition routeDefinition: gatewayProperties.getRoutes()){ for(RouteDefinition routeDefinition: gatewayProperties.getRoutes()){
if (id.equals(routeDefinition.getId())){ if (id.equals(routeDefinition.getId())){
return webFilterChain.filter(serverWebExchange) return webFilterChain.filter(serverWebExchange);
.doOnError(throwable -> LOG.error("handle DynamicRouteFilter[{}] error.", MetadataContextHolder.get(), throwable))
.doFinally((type) -> MetadataContextHolder.remove());
} }
} }
@ -99,9 +97,7 @@ public class DynamicRouteScgFilter implements WebFilter, Ordered {
definition.setPredicates(Arrays.asList(predicate)); definition.setPredicates(Arrays.asList(predicate));
dynamicRouteService.add(definition); dynamicRouteService.add(definition);
return webFilterChain.filter(serverWebExchange) return webFilterChain.filter(serverWebExchange);
.doOnError(throwable -> LOG.error("handle DynamicRouteFilter[{}] error.", MetadataContextHolder.get(), throwable))
.doFinally((type) -> MetadataContextHolder.remove());
} }
} }
Loading…
Cancel
Save