1
0
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:
Nedyalko Dyakov
2025-10-15 15:43:17 +03:00
parent 07283ecfc6
commit 1bbf2e6781
3 changed files with 15 additions and 9 deletions

View File

@@ -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() {