Skip to content

Commit 2cdd5ea

Browse files
authored
fix: eval api cmd.SetFirstKeyPos (#2501)
Signed-off-by: monkey92t <[email protected]>
1 parent cccfca4 commit 2cdd5ea

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

commands.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3323,7 +3323,12 @@ func (c cmdable) eval(ctx context.Context, name, payload string, keys []string,
33233323
}
33243324
cmdArgs = appendArgs(cmdArgs, args)
33253325
cmd := NewCmd(ctx, cmdArgs...)
3326-
cmd.SetFirstKeyPos(3)
3326+
3327+
// it is possible that only args exist without a key.
3328+
// rdb.eval(ctx, eval, script, nil, arg1, arg2)
3329+
if len(keys) > 0 {
3330+
cmd.SetFirstKeyPos(3)
3331+
}
33273332
_ = c(ctx, cmd)
33283333
return cmd
33293334
}

0 commit comments

Comments
 (0)