Skip to content

Commit

Permalink
Issue apache#301 sentinel plugin bug fix (apache#346)
Browse files Browse the repository at this point in the history
* add sentinel plugin

* [apache#301]add custom config for sentinel plugin and support fuse for sentinel plugin

* [apache#301]sentinel plugin bug fix
  • Loading branch information
tydhot authored Nov 13, 2020
1 parent be82679 commit 025bef0
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public void handlerRule(final RuleData ruleData) {

List<FlowRule> flowRules = FlowRuleManager.getRules()
.stream()
.filter(r -> r.getResource().equals(getResourceName(ruleData)))
.filter(r -> !r.getResource().equals(getResourceName(ruleData)))
.collect(Collectors.toList());
if (sentinelHandle.getFlowRuleEnable() == 1) {
FlowRule rule = new FlowRule(getResourceName(ruleData));
Expand All @@ -57,7 +57,7 @@ public void handlerRule(final RuleData ruleData) {

List<DegradeRule> degradeRules = DegradeRuleManager.getRules()
.stream()
.filter(r -> r.getResource().equals(getResourceName(ruleData)))
.filter(r -> !r.getResource().equals(getResourceName(ruleData)))
.collect(Collectors.toList());
if (sentinelHandle.getDegradeRuleEnable() == 1) {
DegradeRule rule = new DegradeRule(getResourceName(ruleData));
Expand All @@ -73,11 +73,11 @@ public void handlerRule(final RuleData ruleData) {
public void removeRule(final RuleData ruleData) {
FlowRuleManager.loadRules(FlowRuleManager.getRules()
.stream()
.filter(r -> r.getResource().equals(getResourceName(ruleData)))
.filter(r -> !r.getResource().equals(getResourceName(ruleData)))
.collect(Collectors.toList()));
DegradeRuleManager.loadRules(DegradeRuleManager.getRules()
.stream()
.filter(r -> r.getResource().equals(getResourceName(ruleData)))
.filter(r -> !r.getResource().equals(getResourceName(ruleData)))
.collect(Collectors.toList()));
}

Expand Down

0 comments on commit 025bef0

Please sign in to comment.