mirror of
https://github.com/HDT3213/godis.git
synced 2025-10-06 09:17:10 +08:00
support rename in cluster
This commit is contained in:
@@ -123,7 +123,7 @@ func execMGet(cluster *core.Cluster, c redis.Connection, cmdLine CmdLine) redis.
|
||||
for node, ret := range nodeResults {
|
||||
nodeCmdLine := cmdLineMap[node]
|
||||
result := ret.(*protocol.MultiBulkReply)
|
||||
if len(result.Args) != len(nodeCmdLine) - 1 {
|
||||
if len(result.Args) != len(nodeCmdLine)-1 {
|
||||
return protocol.MakeErrReply("wrong response from node " + node)
|
||||
}
|
||||
for i := 1; i < len(nodeCmdLine); i++ {
|
||||
@@ -143,12 +143,12 @@ func execMGet(cluster *core.Cluster, c redis.Connection, cmdLine CmdLine) redis.
|
||||
const someKeysExistsErr = "Some Keys Exists"
|
||||
|
||||
func init() {
|
||||
core.RegisterPreCheck("msetnx", msetNxPrecheck)
|
||||
core.RegisterPrepareFunc("msetnx", msetNxPrecheck)
|
||||
}
|
||||
|
||||
func msetNxPrecheck(cluster *core.Cluster, c redis.Connection, cmdLine CmdLine) redis.Reply {
|
||||
var keys []string
|
||||
for i := 1; i < len(cmdLine); i+=2 {
|
||||
for i := 1; i < len(cmdLine); i += 2 {
|
||||
keys = append(keys, string(cmdLine[i]))
|
||||
}
|
||||
exists := cluster.LocalExists(keys)
|
||||
@@ -202,4 +202,4 @@ func execMSetNx(cluster *core.Cluster, c redis.Connection, cmdLine CmdLine) redi
|
||||
return err
|
||||
}
|
||||
return protocol.MakeIntReply(1)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user