Skip to content

Commit

Permalink
Retry timeout by default
Browse files Browse the repository at this point in the history
  • Loading branch information
vmihailenco committed Aug 12, 2019
1 parent f6fc23d commit 39b6735
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
11 changes: 4 additions & 7 deletions command.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ func cmdString(cmd Cmder, val interface{}) string {
}
}
return s

}

func cmdFirstKeyPos(cmd Cmder, info *CommandInfo) int {
Expand Down Expand Up @@ -102,13 +101,11 @@ type baseCmd struct {
var _ Cmder = (*Cmd)(nil)

func (cmd *baseCmd) Name() string {
if len(cmd._args) > 0 {
// Cmd name must be lower cased.
s := internal.ToLower(cmd.stringArg(0))
cmd._args[0] = s
return s
if len(cmd._args) == 0 {
return ""
}
return ""
// Cmd name must be lower cased.
return internal.ToLower(cmd.stringArg(0))
}

func (cmd *baseCmd) Args() []interface{} {
Expand Down
3 changes: 1 addition & 2 deletions redis.go
Original file line number Diff line number Diff line change
Expand Up @@ -268,13 +268,12 @@ func (c *baseClient) _process(ctx context.Context, cmd Cmder) error {
}
}

var retryTimeout bool
retryTimeout := true
lastErr = c.withConn(ctx, func(ctx context.Context, cn *pool.Conn) error {
err := cn.WithWriter(ctx, c.opt.WriteTimeout, func(wr *proto.Writer) error {
return writeCmd(wr, cmd)
})
if err != nil {
retryTimeout = true
return err
}

Expand Down

0 comments on commit 39b6735

Please sign in to comment.