Run optimistically uses EVALSHA to run the script. If script does not exist it is retried using EVAL.
(ctx context.Context, c Scripter, keys []string, args ...interface{})
| 191 | // Run optimistically uses EVALSHA to run the script. If script does not exist |
| 192 | // it is retried using EVAL. |
| 193 | func (s *Script) Run(ctx context.Context, c Scripter, keys []string, args ...interface{}) *Cmd { |
| 194 | r := s.EvalSha(ctx, c, keys, args...) |
| 195 | if errors.Is(r.Err(), ErrNoScript) { |
| 196 | return s.Eval(ctx, c, keys, args...) |
| 197 | } |
| 198 | return r |
| 199 | } |
| 200 | |
| 201 | // RunRO optimistically uses EVALSHA_RO to run the script. If script does not exist |
| 202 | // it is retried using EVAL_RO. |