[Fixed] show rule count when parse failed

This commit is contained in:
Skyxim 2022-03-14 21:43:58 +08:00
parent 002163f07b
commit 13c82754ff

View file

@ -124,12 +124,12 @@ func NewRuleSetProvider(name string, behavior P.RuleType, interval time.Duration
onUpdate := func(elm interface{}) error { onUpdate := func(elm interface{}) error {
rulesRaw := elm.([]string) rulesRaw := elm.([]string)
rp.count = len(rulesRaw)
rules, err := constructRules(rp.behavior, rulesRaw) rules, err := constructRules(rp.behavior, rulesRaw)
if err != nil { if err != nil {
return err return err
} }
rp.count = len(rulesRaw)
rp.setRules(rules) rp.setRules(rules)
return nil return nil
} }