Skip to content

Commit

Permalink
rm lock
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviagolden0 committed May 20, 2024
1 parent 7e04d04 commit 10d9909
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions rules/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,8 @@ func (e *v3Engine) AddRule(rule DynamicRule,
lockPattern string,
callback V3RuleTaskCallback,
options ...RuleOption) {
if !validPath.MatchString(lockPattern) || !strings.Contains(lockPattern, "lock") {
e.logger.Fatal("Path contains an invalid character or does not contain \"lock\"")
if !validPath.MatchString(lockPattern) {
e.logger.Fatal("Path contains an invalid character")
} else {
e.addRuleWithIface(rule, lockPattern, callback, options...)
}
Expand Down
2 changes: 1 addition & 1 deletion v3enginetest/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ func main() {
doneFalse := "false"
doneRule, err := rules.NewEqualsLiteralRule(donePath, &doneFalse)
check(err)
engine.AddRule(doneRule, "/rulesEngineDone/:id/lock", func(task *rules.V3RuleTask) {
engine.AddRule(doneRule, "/rulesEngineDone/:id", func(task *rules.V3RuleTask) {
path := task.Attr.Format(donePath)
doneTrue := "true"
_, err := kv.Put(task.Context, path, doneTrue)
Expand Down

0 comments on commit 10d9909

Please sign in to comment.