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

Method createNewConnection

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

Source from the content-addressed store, hash-verified

265}
266
267func (pool *Pool) createNewConnection() (Connection, error) {
268 var connection Connection
269 var err error
270
271 connection.conn, err = pool.connect()
272 if err != nil {
273 return Connection{}, errors.Errorf(`Could not connect to mysql: %s`, err)
274 }
275 connection.lastUseAt = pool.nowTs()
276
277 pool.synchro.Lock()
278 pool.synchro.stats.CreatedCount++
279 pool.synchro.Unlock()
280
281 return connection, nil
282}
283
284func (pool *Pool) getIdleConnectionUnsafe() Connection {
285 cnt := len(pool.synchro.idleConnections)

Callers 2

newConnectionProducerMethod · 0.95
startNewConnectionsMethod · 0.95

Calls 1

nowTsMethod · 0.95

Tested by

no test coverage detected