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

Method putConnectionUnsafe

IceFireDB-SQLite/pkg/mysql/client/pool.go:218–225  ·  view source on GitHub ↗
(connection Connection)

Source from the content-addressed store, hash-verified

216}
217
218func (pool *Pool) putConnectionUnsafe(connection Connection) {
219 if len(pool.synchro.idleConnections) == cap(pool.synchro.idleConnections) {
220 pool.synchro.stats.TotalCount--
221 _ = connection.conn.Close() // Could it be more effective to close older connections?
222 } else {
223 pool.synchro.idleConnections = append(pool.synchro.idleConnections, connection)
224 }
225}
226
227func (pool *Pool) newConnectionProducer() {
228 var connection Connection

Callers 2

putConnectionMethod · 0.95
startNewConnectionsMethod · 0.95

Calls 1

CloseMethod · 0.65

Tested by

no test coverage detected