Skip to content

Commit 2b8023c

Browse files
committed
use pool size for semsize
1 parent 4673c62 commit 2b8023c

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

internal/pool/pool.go

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -159,18 +159,9 @@ type ConnPool struct {
159159
var _ Pooler = (*ConnPool)(nil)
160160

161161
func NewConnPool(opt *Options) *ConnPool {
162-
semSize := opt.PoolSize
163-
if opt.MaxActiveConns > 0 && opt.MaxActiveConns < opt.PoolSize {
164-
if opt.MaxActiveConns < opt.PoolSize {
165-
opt.MaxActiveConns = opt.PoolSize
166-
}
167-
semSize = opt.MaxActiveConns
168-
}
169-
//semSize = opt.PoolSize
170-
171162
p := &ConnPool{
172163
cfg: opt,
173-
semaphore: internal.NewFastSemaphore(semSize),
164+
semaphore: internal.NewFastSemaphore(opt.PoolSize),
174165
queue: make(chan struct{}, opt.PoolSize),
175166
conns: make(map[uint64]*Conn),
176167
dialsInProgress: make(chan struct{}, opt.MaxConcurrentDials),

0 commit comments

Comments
 (0)