1
0
mirror of https://github.com/redis/go-redis.git synced 2025-12-03 18:31:14 +03:00

use pool size for semsize

This commit is contained in:
Nedyalko Dyakov
2025-11-05 22:03:49 +02:00
parent 4673c621ff
commit 2b8023cb17

View File

@@ -159,18 +159,9 @@ type ConnPool struct {
var _ Pooler = (*ConnPool)(nil)
func NewConnPool(opt *Options) *ConnPool {
semSize := opt.PoolSize
if opt.MaxActiveConns > 0 && opt.MaxActiveConns < opt.PoolSize {
if opt.MaxActiveConns < opt.PoolSize {
opt.MaxActiveConns = opt.PoolSize
}
semSize = opt.MaxActiveConns
}
//semSize = opt.PoolSize
p := &ConnPool{
cfg: opt,
semaphore: internal.NewFastSemaphore(semSize),
semaphore: internal.NewFastSemaphore(opt.PoolSize),
queue: make(chan struct{}, opt.PoolSize),
conns: make(map[uint64]*Conn),
dialsInProgress: make(chan struct{}, opt.MaxConcurrentDials),