Skip to content

Commit 73b679c

Browse files
undo changes made by mistake
Signed-off-by: Arthur Schreiber <[email protected]>
1 parent 5b330bd commit 73b679c

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

go/pools/smartconnpool/pool.go

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -592,9 +592,7 @@ func (pool *ConnPool[C]) get(ctx context.Context) (*Pooled[C], error) {
592592
// to other clients, wait until one of the connections is returned
593593
if conn == nil {
594594
start := time.Now()
595-
conn, err = pool.wait.waitForConn(ctx, nil, func() bool {
596-
return pool.capacity.Load() == 0
597-
})
595+
conn, err = pool.wait.waitForConn(ctx, nil)
598596
if err != nil {
599597
return nil, ErrTimeout
600598
}
@@ -651,9 +649,7 @@ func (pool *ConnPool[C]) getWithSetting(ctx context.Context, setting *Setting) (
651649
// wait for one of them
652650
if conn == nil {
653651
start := time.Now()
654-
conn, err = pool.wait.waitForConn(ctx, setting, func() bool {
655-
return pool.capacity.Load() == 0
656-
})
652+
conn, err = pool.wait.waitForConn(ctx, setting)
657653
if err != nil {
658654
return nil, ErrTimeout
659655
}

0 commit comments

Comments
 (0)