()
| 280 | } |
| 281 | |
| 282 | func (pool *Pool) getIdleConnectionUnsafe() Connection { |
| 283 | cnt := len(pool.synchro.idleConnections) |
| 284 | if cnt == 0 { |
| 285 | return Connection{} |
| 286 | } |
| 287 | |
| 288 | last := cnt - 1 |
| 289 | connection := pool.synchro.idleConnections[last] |
| 290 | pool.synchro.idleConnections[last].conn = nil |
| 291 | pool.synchro.idleConnections = pool.synchro.idleConnections[:last] |
| 292 | |
| 293 | return connection |
| 294 | } |
| 295 | |
| 296 | func (pool *Pool) closeOldIdleConnections() { |
| 297 | var toPing []Connection |
no outgoing calls
no test coverage detected