Skip to content

Commit

Permalink
Use strings.Contains for script error matching
Browse files Browse the repository at this point in the history
  • Loading branch information
subtlepseudonym committed Jun 16, 2022
1 parent 52511c8 commit 9e499b5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion redis/goredis/v8/goredis.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func (c *conn) Eval(script *redsyncredis.Script, keysAndArgs ...interface{}) (in
}

v, err := c.delegate.EvalSha(c.ctx, script.Hash, keys, args...).Result()
if err != nil && strings.HasPrefix(err.Error(), "NOSCRIPT ") {
if err != nil && strings.Contains(err.Error(), "NOSCRIPT ") {
v, err = c.delegate.Eval(c.ctx, script.Src, keys, args...).Result()
}
return v, noErrNil(err)
Expand Down

0 comments on commit 9e499b5

Please sign in to comment.