mirror of
https://github.com/redis/go-redis.git
synced 2025-10-18 22:08:50 +03:00
few small improvements
This commit is contained in:
4
redis.go
4
redis.go
@@ -322,7 +322,7 @@ func (c *baseClient) connReAuthCredentialsListener(poolCn *pool.Conn) (auth.Cred
|
||||
// Design decision: The main case we expect the connection to be in a non-usable state is when it is being reconnected
|
||||
// during a handoff from maintnotifications.
|
||||
// Setting the checkUsableTimeout to the handoff timeout if maintnotifications are enabled
|
||||
// the default timeout if no maintnotifications are disabled is going to be 1 second.
|
||||
// the default timeout if no maintnotifications are disabled is going to PoolTimeout.
|
||||
//
|
||||
// Note: Due to the auto by default mode of MaintNotificationsConfig
|
||||
// the timeout for the first connection will probably be the value of MaintNotificationsConfig.HandoffTimeout
|
||||
@@ -330,6 +330,8 @@ func (c *baseClient) connReAuthCredentialsListener(poolCn *pool.Conn) (auth.Cred
|
||||
// of enabling maintnotifications later.
|
||||
if c.opt.MaintNotificationsConfig != nil && c.opt.MaintNotificationsConfig.Mode != maintnotifications.ModeDisabled {
|
||||
newCredListener.SetCheckUsableTimeout(c.opt.MaintNotificationsConfig.HandoffTimeout)
|
||||
} else {
|
||||
newCredListener.SetCheckUsableTimeout(c.opt.PoolTimeout)
|
||||
}
|
||||
c.credListeners[poolCn] = newCredListener
|
||||
return newCredListener, func() {
|
||||
|
Reference in New Issue
Block a user