Skip to content

Commit

Permalink
fix build fail
Browse files Browse the repository at this point in the history
  • Loading branch information
psrvere committed Dec 16, 2024
1 parent c89b688 commit 4aab95c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions internal/server/httpws/httpServer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions internal/server/httpws/websocketServer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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))
}
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 4aab95c

Please sign in to comment.