From 72b26248ca9402166f15dd4cae6f2eefac6f871a Mon Sep 17 00:00:00 2001 From: mitchsw Date: Tue, 28 Jun 2022 14:27:54 -0400 Subject: [PATCH] respect ctx in cmds run in DialContext --- redis/conn.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/redis/conn.go b/redis/conn.go index a30100d7..3695b843 100644 --- a/redis/conn.go +++ b/redis/conn.go @@ -291,21 +291,21 @@ func DialContext(ctx context.Context, network, address string, options ...DialOp authArgs = append(authArgs, do.username) } authArgs = append(authArgs, do.password) - if _, err := c.Do("AUTH", authArgs...); err != nil { + if _, err := c.DoContext(ctx, "AUTH", authArgs...); err != nil { netConn.Close() return nil, err } } if do.clientName != "" { - if _, err := c.Do("CLIENT", "SETNAME", do.clientName); err != nil { + if _, err := c.DoContext(ctx, "CLIENT", "SETNAME", do.clientName); err != nil { netConn.Close() return nil, err } } if do.db != 0 { - if _, err := c.Do("SELECT", do.db); err != nil { + if _, err := c.DoContext(ctx, "SELECT", do.db); err != nil { netConn.Close() return nil, err }