@@ -723,21 +723,6 @@ func NewClusterClient(opt *ClusterOptions) *ClusterClient {
723723 return c
724724}
725725
726- func (c * ClusterClient ) Context () context.Context {
727- return c .ctx
728- }
729-
730- func (c * ClusterClient ) WithContext (ctx context.Context ) * ClusterClient {
731- if ctx == nil {
732- panic ("nil context" )
733- }
734- clone := * c
735- clone .cmdable = clone .Process
736- clone .hooks .lock ()
737- clone .ctx = ctx
738- return & clone
739- }
740-
741726// Options returns read-only Options that were used to create the client.
742727func (c * ClusterClient ) Options () * ClusterOptions {
743728 return c .opt
@@ -1069,15 +1054,14 @@ func (c *ClusterClient) reaper(idleCheckFrequency time.Duration) {
10691054 for _ , node := range nodes {
10701055 _ , err := node .Client .connPool .(* pool.ConnPool ).ReapStaleConns ()
10711056 if err != nil {
1072- internal .Logger .Printf (c . Context (), "ReapStaleConns failed: %s" , err )
1057+ internal .Logger .Printf (context . TODO (), "ReapStaleConns failed: %s" , err )
10731058 }
10741059 }
10751060 }
10761061}
10771062
10781063func (c * ClusterClient ) Pipeline () Pipeliner {
10791064 pipe := Pipeline {
1080- ctx : c .ctx ,
10811065 exec : c .processPipeline ,
10821066 }
10831067 pipe .init ()
@@ -1259,7 +1243,6 @@ func (c *ClusterClient) checkMovedErr(
12591243// TxPipeline acts like Pipeline, but wraps queued commands with MULTI/EXEC.
12601244func (c * ClusterClient ) TxPipeline () Pipeliner {
12611245 pipe := Pipeline {
1262- ctx : c .ctx ,
12631246 exec : c .processTxPipeline ,
12641247 }
12651248 pipe .init ()
@@ -1616,7 +1599,7 @@ func (c *ClusterClient) cmdInfo(name string) *CommandInfo {
16161599
16171600 info := cmdsInfo [name ]
16181601 if info == nil {
1619- internal .Logger .Printf (c . Context (), "info for cmd=%s not found" , name )
1602+ internal .Logger .Printf (context . TODO (), "info for cmd=%s not found" , name )
16201603 }
16211604 return info
16221605}
0 commit comments