diff --git a/rule/provider/classical_strategy.go b/rule/provider/classical_strategy.go index 45700b81..aba2a4e4 100644 --- a/rule/provider/classical_strategy.go +++ b/rule/provider/classical_strategy.go @@ -37,13 +37,14 @@ func (c *classicalStrategy) OnUpdate(rules []string) { r, err := parseRule(ruleType, rule, "", params) if err != nil { log.Warnln("parse rule error:[%s]", err.Error()) - } + } else { + if !shouldResolveIP { + shouldResolveIP = shouldResolveIP || r.ShouldResolveIP() + } - if !shouldResolveIP { - shouldResolveIP = shouldResolveIP || r.ShouldResolveIP() + classicalRules = append(classicalRules, r) + c.count++ } - - classicalRules = append(classicalRules, r) } c.rules = classicalRules