Skip to content

Commit

Permalink
fix spike test
Browse files Browse the repository at this point in the history
Signed-off-by: Vicent Marti <vmg@strn.cat>
  • Loading branch information
vmg committed Feb 12, 2025
1 parent 0375d0a commit d1e244d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions go/pools/smartconnpool/pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -459,10 +459,12 @@ func (pool *ConnPool[C]) pop(stack *connStack[C]) *Pooled[C] {

func (pool *ConnPool[C]) tryReturnAnyConn() bool {
if conn := pool.pop(&pool.clean); conn != nil {
conn.timeUsed.update()
return pool.tryReturnConn(conn)
}
for u := 0; u <= stackMask; u++ {
if conn := pool.pop(&pool.settings[u]); conn != nil {
conn.timeUsed.update()
return pool.tryReturnConn(conn)
}
}
Expand Down

0 comments on commit d1e244d

Please sign in to comment.