Skip to content

Commit

Permalink
Return empty array for COMMAND DOCS because COMMANDS response trigger…
Browse files Browse the repository at this point in the history
…s error in redis-cli
  • Loading branch information
kelvinmwinuka committed Feb 28, 2024
1 parent facdc08 commit 62ef29c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/modules/admin/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,10 @@ func handleCommandList(ctx context.Context, cmd []string, server utils.Server, _
}
}

func handleCommandDocs(ctx context.Context, cmd []string, server utils.Server, _ *net.Conn) ([]byte, error) {
return []byte("*0\r\n"), nil
}

// func handleConfigGet(ctx context.Context, cmd []string, server utils.Server, _ *net.Conn) ([]byte, error) {
// return nil, errors.New("command not yet implemented")
// }
Expand Down Expand Up @@ -189,7 +193,7 @@ func Commands() []utils.Command {
Description: "Get command documentation",
Sync: false,
KeyExtractionFunc: func(cmd []string) ([]string, error) { return []string{}, nil },
HandlerFunc: handleGetAllCommands,
HandlerFunc: handleCommandDocs,
},
{
Command: "count",
Expand Down
2 changes: 2 additions & 0 deletions src/server/modules.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ func (server *Server) handleCommand(ctx context.Context, message []byte, conn *n
return nil, err
}

fmt.Println(cmd)

command, err := server.getCommand(cmd[0])
if err != nil {
return nil, err
Expand Down

0 comments on commit 62ef29c

Please sign in to comment.