mirror of
https://github.com/redis/go-redis.git
synced 2025-12-02 06:22:31 +03:00
use pool size for semsize
This commit is contained in:
@@ -159,18 +159,9 @@ type ConnPool struct {
|
|||||||
var _ Pooler = (*ConnPool)(nil)
|
var _ Pooler = (*ConnPool)(nil)
|
||||||
|
|
||||||
func NewConnPool(opt *Options) *ConnPool {
|
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{
|
p := &ConnPool{
|
||||||
cfg: opt,
|
cfg: opt,
|
||||||
semaphore: internal.NewFastSemaphore(semSize),
|
semaphore: internal.NewFastSemaphore(opt.PoolSize),
|
||||||
queue: make(chan struct{}, opt.PoolSize),
|
queue: make(chan struct{}, opt.PoolSize),
|
||||||
conns: make(map[uint64]*Conn),
|
conns: make(map[uint64]*Conn),
|
||||||
dialsInProgress: make(chan struct{}, opt.MaxConcurrentDials),
|
dialsInProgress: make(chan struct{}, opt.MaxConcurrentDials),
|
||||||
|
|||||||
Reference in New Issue
Block a user