Skip to content

Commit

Permalink
Merge pull request go-redsync#91 from subtlepseudonym/noscript-wrappe…
Browse files Browse the repository at this point in the history
…d-client

Use strings.Contains for script error matching
  • Loading branch information
hjr265 committed Jun 23, 2022
2 parents 52511c8 + 9e499b5 commit 5e47419
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion redis/goredis/v8/goredis.go
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 5e47419

Please sign in to comment.