1
0
mirror of https://github.com/charlienet/go-mixed.git synced 2025-07-18 00:22:41 +08:00

redis rename key

This commit is contained in:
2023-11-01 16:32:58 +08:00
parent f3918dd02b
commit 5f065de145
3 changed files with 7 additions and 3 deletions

View File

@ -49,7 +49,7 @@ func (r renameKey) renameKey(cmd redis.Cmder) {
}
switch strings.ToUpper(cmd.Name()) {
case "SELECT":
case "SELECT", "FUNCTION":
// 无KEY指令
case
"RENAME", "RENAMENX",
@ -69,8 +69,8 @@ func (r renameKey) renameKey(cmd redis.Cmder) {
case "MSET", "MSETNX":
// 间隔KEYKEY位置规则1,3,5,7
r.rename(args, createSepuence(1, len(args), 2)...)
case "EVAL":
// 命令中包含键数量 EVAL script numkeys [key [key ...]] [arg [arg ...]]
case "EVAL", "EVALSHA", "EVALSHA_RO", "FCALL", "FCALL_RO":
// 命令中包含键数量
if n, ok := args[2].(int); ok && n > 0 {
r.rename(args, createSepuence(3, 3+n, 1)...)
}