Skip to content

Commit

Permalink
修复更新,删除service类型的条件路由异常的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
ymybxx committed Dec 24, 2021
1 parent bc280e5 commit cb58156
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ public void updateConditionRoute(ConditionRouteDTO newConditionRoute) {
//for 2.6
if (StringUtils.isNotEmpty(newConditionRoute.getService())) {
for (Route old : convertRouteToOldRoute(oldConditionRoute)) {
old.setService(id);
registry.unregister(old.toUrl().addParameter(Constants.COMPATIBLE_CONFIG, true));
}
for (Route updated : convertRouteToOldRoute(newConditionRoute)) {
Expand All @@ -101,6 +102,7 @@ public void deleteConditionRoute(String id) {
RoutingRule originRule = YamlParser.loadObject(config, RoutingRule.class);
ConditionRouteDTO conditionRouteDTO = RouteUtils.createConditionRouteFromRule(originRule);
for (Route old : convertRouteToOldRoute(conditionRouteDTO)) {
old.setService(id);
URL oldUrl = old.toUrl();
if(oldUrl.getParameter("rule").contains("host") && oldUrl.getParameter("rule").contains("false")) {
registry.unregister(oldUrl);
Expand Down

0 comments on commit cb58156

Please sign in to comment.