mirror of
https://github.com/HDT3213/godis.git
synced 2025-10-06 17:26:52 +08:00
optimize del in cluster
This commit is contained in:
@@ -25,7 +25,6 @@ func execDel(cluster *core.Cluster, c redis.Connection, cmdLine CmdLine) redis.R
|
||||
return protocol.MakeArgNumErrReply("del")
|
||||
}
|
||||
var keys []string
|
||||
keyValues := make(map[string][]byte)
|
||||
for i := 1; i < len(cmdLine); i++ {
|
||||
key := string(cmdLine[i])
|
||||
keys = append(keys, key)
|
||||
@@ -44,8 +43,7 @@ func execDel(cluster *core.Cluster, c redis.Connection, cmdLine CmdLine) redis.R
|
||||
for node, keys := range routeMap {
|
||||
nodeCmdLine := utils.ToCmdLine("del")
|
||||
for _, key := range keys {
|
||||
val := keyValues[key]
|
||||
nodeCmdLine = append(nodeCmdLine, []byte(key), val)
|
||||
nodeCmdLine = append(nodeCmdLine, []byte(key))
|
||||
}
|
||||
cmdLineMap[node] = nodeCmdLine
|
||||
}
|
||||
|
Reference in New Issue
Block a user