add dbsize command

This commit is contained in:
bijingrui
2024-05-05 19:42:22 +08:00
committed by finley
parent dd073b0645
commit 0c6b0863f3
5 changed files with 30 additions and 0 deletions

View File

@@ -155,6 +155,12 @@ func (cluster *Cluster) Exec(c redis.Connection, cmdLine [][]byte) (result redis
return protocol.MakeErrReply("NOAUTH Authentication required")
}
if cmdName == "dbsize" {
if ser, ok := cluster.db.(*database2.Server); ok {
return database2.DbSize(c, ser)
}
}
if cmdName == "multi" {
if len(cmdLine) != 1 {
return protocol.MakeArgNumErrReply(cmdName)