refactor command command

This commit is contained in:
hdt3213
2023-05-04 23:03:06 +08:00
committed by finley
parent 1e767b6797
commit 68d7f28b1a
15 changed files with 434 additions and 422 deletions

View File

@@ -94,13 +94,13 @@ func (server *Server) Exec(c redis.Connection, cmdLine [][]byte) (result redis.R
if cmdName == "auth" {
return Auth(c, cmdLine[1:])
}
if !isAuthenticated(c) {
return protocol.MakeErrReply("NOAUTH Authentication required")
}
// info
if cmdName == "info" {
return Info(c, cmdLine)
}
if !isAuthenticated(c) {
return protocol.MakeErrReply("NOAUTH Authentication required")
}
if cmdName == "slaveof" {
if c != nil && c.InMultiState() {
return protocol.MakeErrReply("cannot use slave of database within multi")