From 261cf7ae704fd1a8ba71ab34c53629d547068d80 Mon Sep 17 00:00:00 2001 From: Vladimir Mihailenco Date: Fri, 8 Jul 2016 09:24:02 +0000 Subject: [PATCH] Fix Del command case. --- cluster.go | 1 + commands.go | 4 ++-- ring.go | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/cluster.go b/cluster.go index 217cadd..07de993 100644 --- a/cluster.go +++ b/cluster.go @@ -235,6 +235,7 @@ func (c *ClusterClient) slotClosestNode(slot int) (*clusterNode, error) { func (c *ClusterClient) cmdSlotAndNode(cmd Cmder) (int, *clusterNode, error) { cmdInfo := c.cmdInfo(cmd.arg(0)) if cmdInfo == nil { + internal.Logf("info for cmd=%s not found", cmd.arg(0)) node, err := c.randomNode() return 0, node, err } diff --git a/commands.go b/commands.go index 412adae..db9d806 100644 --- a/commands.go +++ b/commands.go @@ -82,7 +82,7 @@ func (c *statefulCmdable) Select(index int) *StatusCmd { func (c *cmdable) Del(keys ...string) *IntCmd { args := make([]interface{}, 1+len(keys)) - args[0] = "DEL" + args[0] = "del" for i, key := range keys { args[1+i] = key } @@ -550,7 +550,7 @@ func (c *cmdable) Set(key string, value interface{}, expiration time.Duration) * func (c *cmdable) SetBit(key string, offset int64, value int) *IntCmd { cmd := NewIntCmd( - "SETBIT", + "setbit", key, offset, value, diff --git a/ring.go b/ring.go index 8c998a8..b0c0179 100644 --- a/ring.go +++ b/ring.go @@ -169,6 +169,7 @@ func (c *Ring) cmdInfo(name string) *CommandInfo { func (c *Ring) cmdFirstKey(cmd Cmder) string { cmdInfo := c.cmdInfo(cmd.arg(0)) if cmdInfo == nil { + internal.Logf("info for cmd=%s not found", cmd.arg(0)) return "" } return cmd.arg(int(cmdInfo.FirstKeyPos))