Skip to content

Commit

Permalink
Document Script.Run. Fixes redis#536
Browse files Browse the repository at this point in the history
  • Loading branch information
vmihailenco committed Apr 8, 2017
1 parent dd76391 commit 2e49447
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions script.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ func (s *Script) EvalSha(c scripter, keys []string, args ...interface{}) *Cmd {
return c.EvalSha(s.hash, keys, args...)
}

// Run optimistically uses EVALSHA to run the script. If script does not exist
// it is retried using EVAL.
func (s *Script) Run(c scripter, keys []string, args ...interface{}) *Cmd {
r := s.EvalSha(c, keys, args...)
if err := r.Err(); err != nil && strings.HasPrefix(err.Error(), "NOSCRIPT ") {
Expand Down

0 comments on commit 2e49447

Please sign in to comment.