diff --git a/go.mod b/go.mod index 6ff32c9d5..1c2e15565 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,7 @@ require ( github.com/fatih/color v1.14.1 // indirect github.com/fsnotify/fsnotify v1.7.0 github.com/go-zookeeper/zk v1.0.3 - github.com/gomodule/redigo v1.8.9 + github.com/gomodule/redigo v1.9.2 github.com/hashicorp/consul/api v1.27.0 github.com/hashicorp/vault/api v1.10.0 github.com/kelseyhightower/memkv v0.1.1 diff --git a/go.sum b/go.sum index 61dd4fb82..4d27f2665 100644 --- a/go.sum +++ b/go.sum @@ -57,8 +57,8 @@ github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5y github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/gomodule/redigo v1.8.9 h1:Sl3u+2BI/kk+VEatbj0scLdrFhjPmbxOc1myhDP41ws= -github.com/gomodule/redigo v1.8.9/go.mod h1:7ArFNvsTjH8GMMzB4uy1snslv2BwmginuMs06a1uzZE= +github.com/gomodule/redigo v1.9.2 h1:HrutZBLhSIU8abiSfW8pj8mPhOyMYjZT/wcA4/L9L9s= +github.com/gomodule/redigo v1.9.2/go.mod h1:KsU3hiK/Ay8U42qpaJk+kuNa3C+spxapWpM+ywhcgtw= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.1 h1:gK4Kx5IaGY9CD5sPJ36FHiBJ6ZXl0kilRiiCj+jdYp4= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= diff --git a/vendor/github.com/gomodule/redigo/redis/pool.go b/vendor/github.com/gomodule/redigo/redis/pool.go index d7bb71e07..8e22f66b3 100644 --- a/vendor/github.com/gomodule/redigo/redis/pool.go +++ b/vendor/github.com/gomodule/redigo/redis/pool.go @@ -128,16 +128,24 @@ type Pool struct { // DialContext is an application supplied function for creating and configuring a // connection with the given context. // - // The connection returned from Dial must not be in a special state + // The connection returned from DialContext must not be in a special state // (subscribed to pubsub channel, transaction started, ...). DialContext func(ctx context.Context) (Conn, error) // TestOnBorrow is an optional application supplied function for checking // the health of an idle connection before the connection is used again by - // the application. Argument t is the time that the connection was returned + // the application. Argument lastUsed is the time when the connection was returned + // to the pool. If the function returns an error, then the connection is + // closed. + TestOnBorrow func(c Conn, lastUsed time.Time) error + + // TestOnBorrowContext is an optional application supplied function + // for checking the health of an idle connection with the given context + // before the connection is used again by the application. + // Argument lastUsed is the time when the connection was returned // to the pool. If the function returns an error, then the connection is // closed. - TestOnBorrow func(c Conn, t time.Time) error + TestOnBorrowContext func(ctx context.Context, c Conn, lastUsed time.Time) error // Maximum number of idle connections in the pool. MaxIdle int @@ -228,6 +236,7 @@ func (p *Pool) GetContext(ctx context.Context) (Conn, error) { p.idle.popFront() p.mu.Unlock() if (p.TestOnBorrow == nil || p.TestOnBorrow(pc.c, pc.t) == nil) && + (p.TestOnBorrowContext == nil || p.TestOnBorrowContext(ctx, pc.c, pc.t) == nil) && (p.MaxConnLifetime == 0 || nowFunc().Sub(pc.created) < p.MaxConnLifetime) { return &activeConn{p: p, pc: pc}, nil } diff --git a/vendor/modules.txt b/vendor/modules.txt index 52aa7e13c..f14382ace 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -89,8 +89,8 @@ github.com/golang/protobuf/ptypes github.com/golang/protobuf/ptypes/any github.com/golang/protobuf/ptypes/duration github.com/golang/protobuf/ptypes/timestamp -# github.com/gomodule/redigo v1.8.9 -## explicit; go 1.16 +# github.com/gomodule/redigo v1.9.2 +## explicit; go 1.17 github.com/gomodule/redigo/redis # github.com/hashicorp/consul/api v1.27.0 ## explicit; go 1.19