mirror of
https://github.com/HDT3213/godis.git
synced 2025-10-06 01:07:06 +08:00
support msetnx in cluster by tcc pre-check hook
This commit is contained in:
@@ -79,3 +79,15 @@ func execRaftCommittedIndex(cluster *Cluster, c redis.Connection, cmdLine CmdLin
|
||||
}
|
||||
return protocol.MakeIntReply(int64(index))
|
||||
}
|
||||
|
||||
// LocalExists returns existed ones from `keys` in local node
|
||||
func (cluster *Cluster) LocalExists(keys []string) []string {
|
||||
var exists []string
|
||||
for _, key := range keys {
|
||||
_, ok := cluster.db.GetEntity(0, key)
|
||||
if ok {
|
||||
exists = append(exists, key)
|
||||
}
|
||||
}
|
||||
return exists
|
||||
}
|
||||
|
Reference in New Issue
Block a user