diff --git a/internal/server/httpws/httpServer.go b/internal/server/httpws/httpServer.go index e67d0b95e..f4b82da6d 100644 --- a/internal/server/httpws/httpServer.go +++ b/internal/server/httpws/httpServer.go @@ -28,7 +28,7 @@ import ( "sync" "time" - "github.com/dicedb/dice/internal/iothread" + "github.com/dicedb/dice/internal/commandhandler" "github.com/dicedb/dice/internal/eval" "github.com/dicedb/dice/internal/server/abstractserver" @@ -158,7 +158,7 @@ func (s *HTTPServer) DiceHTTPHandler(writer http.ResponseWriter, request *http.R return } - if iothread.CommandsMeta[diceDBCmd.Cmd].CmdType == iothread.MultiShard { + if commandhandler.CommandsMeta[diceDBCmd.Cmd].CmdType == commandhandler.MultiShard { writeErrorResponse(writer, http.StatusBadRequest, "unsupported command", "Unsupported command received", slog.String("cmd", diceDBCmd.Cmd)) return @@ -355,9 +355,9 @@ func (s *HTTPServer) writeResponse(writer http.ResponseWriter, result *ops.Store // Check if the command is migrated, if it is we use EvalResponse values // else we use RESPParser to decode the response - _, ok := iothread.CommandsMeta[diceDBCmd.Cmd] + _, ok := commandhandler.CommandsMeta[diceDBCmd.Cmd] // TODO: Remove this conditional check and if (true) condition when all commands are migrated - if !ok || iothread.CommandsMeta[diceDBCmd.Cmd].CmdType == iothread.Custom { + if !ok || commandhandler.CommandsMeta[diceDBCmd.Cmd].CmdType == commandhandler.Custom { responseValue, err = DecodeEvalResponse(result.EvalResponse) if err != nil { slog.Error("Error decoding response", "error", err) diff --git a/internal/server/httpws/websocketServer.go b/internal/server/httpws/websocketServer.go index 66bbe79fb..f1fb8b142 100644 --- a/internal/server/httpws/websocketServer.go +++ b/internal/server/httpws/websocketServer.go @@ -30,7 +30,7 @@ import ( "syscall" "time" - "github.com/dicedb/dice/internal/iothread" + "github.com/dicedb/dice/internal/commandhandler" "github.com/dicedb/dice/internal/server/abstractserver" "github.com/dicedb/dice/internal/wal" @@ -173,7 +173,7 @@ func (s *WebsocketServer) WebsocketHandler(w http.ResponseWriter, r *http.Reques continue } - if iothread.CommandsMeta[diceDBCmd.Cmd].CmdType == iothread.MultiShard { + if commandhandler.CommandsMeta[diceDBCmd.Cmd].CmdType == commandhandler.MultiShard { if err := WriteResponseWithRetries(conn, []byte("error: unsupported command"), maxRetries); err != nil { slog.Debug(fmt.Sprintf("Error writing message: %v", err)) } @@ -298,7 +298,7 @@ func (s *WebsocketServer) processResponse(conn *websocket.Conn, diceDBCmd *cmd.D var responseValue interface{} // Check if the command is migrated, if it is we use EvalResponse values // else we use RESPParser to decode the response - _, ok := iothread.CommandsMeta[diceDBCmd.Cmd] + _, ok := commandhandler.CommandsMeta[diceDBCmd.Cmd] // TODO: Remove this conditional check and if (true) condition when all commands are migrated if !ok { responseValue, err = DecodeEvalResponse(response.EvalResponse)