Skip to content

Commit

Permalink
fix: eval api cmd.SetFirstKeyPos (redis#2501)
Browse files Browse the repository at this point in the history
Signed-off-by: monkey92t <[email protected]>
  • Loading branch information
monkey92t authored Mar 28, 2023
1 parent cccfca4 commit 2cdd5ea
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 2cdd5ea

Please sign in to comment.