mirror of https://github.com/go-redis/redis.git
fix: eval api cmd.SetFirstKeyPos (#2501)
Signed-off-by: monkey92t <golang@88.com>
This commit is contained in:
parent
cccfca4593
commit
2cdd5ea34a
|
@ -3323,7 +3323,12 @@ func (c cmdable) eval(ctx context.Context, name, payload string, keys []string,
|
|||
}
|
||||
cmdArgs = appendArgs(cmdArgs, args)
|
||||
cmd := NewCmd(ctx, cmdArgs...)
|
||||
cmd.SetFirstKeyPos(3)
|
||||
|
||||
// it is possible that only args exist without a key.
|
||||
// rdb.eval(ctx, eval, script, nil, arg1, arg2)
|
||||
if len(keys) > 0 {
|
||||
cmd.SetFirstKeyPos(3)
|
||||
}
|
||||
_ = c(ctx, cmd)
|
||||
return cmd
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue