mirror of
https://github.com/redis/go-redis.git
synced 2025-10-26 06:51:16 +03:00
address pr comments
This commit is contained in:
@@ -62,7 +62,8 @@ func (r *ReAuthPoolHook) OnGet(_ context.Context, conn *pool.Conn, _ bool) (acce
|
|||||||
r.scheduledLock.RUnlock()
|
r.scheduledLock.RUnlock()
|
||||||
// has scheduled reauth, reject the connection
|
// has scheduled reauth, reject the connection
|
||||||
if ok && hasScheduled {
|
if ok && hasScheduled {
|
||||||
// simply reject the connection, it will be re-authenticated in OnPut
|
// simply reject the connection, it currently has a reauth scheduled
|
||||||
|
// and the worker is waiting for slot to execute the reauth
|
||||||
return false, nil
|
return false, nil
|
||||||
}
|
}
|
||||||
return true, nil
|
return true, nil
|
||||||
@@ -149,9 +150,6 @@ func (r *ReAuthPoolHook) OnRemove(_ context.Context, conn *pool.Conn, _ error) {
|
|||||||
r.scheduledLock.Lock()
|
r.scheduledLock.Lock()
|
||||||
delete(r.scheduledReAuth, conn.GetID())
|
delete(r.scheduledReAuth, conn.GetID())
|
||||||
r.scheduledLock.Unlock()
|
r.scheduledLock.Unlock()
|
||||||
r.shouldReAuthLock.Lock()
|
|
||||||
delete(r.shouldReAuth, conn.GetID())
|
|
||||||
r.shouldReAuthLock.Unlock()
|
|
||||||
r.ClearReAuthMark(conn.GetID())
|
r.ClearReAuthMark(conn.GetID())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user