Skip to content

Commit

Permalink
err check
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviagolden0 committed May 16, 2024
1 parent 8337f7a commit d622871
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 4 additions & 1 deletion rules/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,10 @@ func (e *v3Engine) AddPolling(namespacePattern string, preconditions DynamicRule
lease: e.cl,
engine: e,
}
e.AddRule(rule, "/rule_locks"+namespacePattern+"lock", cbw.doRule, RuleID(namespacePattern))
err = e.AddRule(rule, "/rule_locks"+namespacePattern+"lock", cbw.doRule, RuleID(namespacePattern))
if err != nil {
return err
}
return nil
}

Expand Down
3 changes: 2 additions & 1 deletion v3enginetest/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,12 +170,13 @@ func main() {
doneFalse := "false"
doneRule, err := rules.NewEqualsLiteralRule(donePath, &doneFalse)
check(err)
engine.AddRule(doneRule, "/rulesEngineDone/:id", func(task *rules.V3RuleTask) {
err = engine.AddRule(doneRule, "/rulesEngineDone/:id", func(task *rules.V3RuleTask) {
path := task.Attr.Format(donePath)
doneTrue := "true"
_, err := kv.Put(task.Context, path, doneTrue)
check(err)
}, rules.RuleID(doneRuleID))
check(err)

engine.Run()
time.Sleep(time.Second)
Expand Down

0 comments on commit d622871

Please sign in to comment.