MCPcopy
hub / github.com/redis/go-redis / Run

Method Run

script.go:193–199  ·  script.go::Script.Run

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{})

Source from the content-addressed store, hash-verified

191// Run optimistically uses EVALSHA to run the script. If script does not exist
192// it is retried using EVAL.
193func (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.

Calls 3

EvalShaMethod · 0.95
EvalMethod · 0.95
ErrMethod · 0.65