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

Method putConnectionUnsafe

IceFireDB-SQLProxy/pkg/mysql/client/pool.go:220–227  ·  view source on GitHub ↗
(connection Connection)

Source from the content-addressed store, hash-verified

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

Callers 2

putConnectionMethod · 0.95
startNewConnectionsMethod · 0.95

Calls 1

CloseMethod · 0.65

Tested by

no test coverage detected