1
0
mirror of https://github.com/redis/go-redis.git synced 2025-10-18 22:08:50 +03:00

add Used to clarify the state of the conn

This commit is contained in:
Nedyalko Dyakov
2025-10-15 18:44:10 +03:00
parent 14280684ae
commit e7dc339478
6 changed files with 89 additions and 13 deletions

View File

@@ -549,6 +549,7 @@ func (c *baseClient) initConn(ctx context.Context, cn *pool.Conn) error {
// mark the connection as usable and inited
// once returned to the pool as idle, this connection can be used by other clients
cn.SetUsable(true)
cn.Used.Store(false)
cn.Inited.Store(true)
// Set the connection initialization function for potential reconnections