mirror of
https://github.com/redis/go-redis.git
synced 2025-07-31 05:04:23 +03:00
Fix ReceiveMessage to work without any subscriptions.
This commit is contained in:
@ -41,7 +41,6 @@ type Pooler interface {
|
||||
FreeLen() int
|
||||
Stats() *Stats
|
||||
Close() error
|
||||
Closed() bool
|
||||
}
|
||||
|
||||
type dialer func() (net.Conn, error)
|
||||
@ -132,7 +131,7 @@ func (p *ConnPool) popFree() *Conn {
|
||||
|
||||
// Get returns existed connection from the pool or creates a new one.
|
||||
func (p *ConnPool) Get() (*Conn, bool, error) {
|
||||
if p.Closed() {
|
||||
if p.closed() {
|
||||
return nil, false, ErrClosed
|
||||
}
|
||||
|
||||
@ -241,7 +240,7 @@ func (p *ConnPool) Stats() *Stats {
|
||||
}
|
||||
}
|
||||
|
||||
func (p *ConnPool) Closed() bool {
|
||||
func (p *ConnPool) closed() bool {
|
||||
return atomic.LoadInt32(&p._closed) == 1
|
||||
}
|
||||
|
||||
@ -318,7 +317,7 @@ func (p *ConnPool) reaper(frequency time.Duration) {
|
||||
defer ticker.Stop()
|
||||
|
||||
for _ = range ticker.C {
|
||||
if p.Closed() {
|
||||
if p.closed() {
|
||||
break
|
||||
}
|
||||
n, err := p.ReapStaleConns()
|
||||
|
Reference in New Issue
Block a user