MCPcopy Create free account
hub / github.com/IceFireDB/IceFireDB / getIdleConnectionUnsafe

Method getIdleConnectionUnsafe

IceFireDB-SQLite/pkg/mysql/client/pool.go:282–294  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

280}
281
282func (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
296func (pool *Pool) closeOldIdleConnections() {
297 var toPing []Connection

Callers 2

getConnectionMethod · 0.95
newConnectionProducerMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected