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

Method createNewConnection

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

Source from the content-addressed store, hash-verified

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

Callers 2

newConnectionProducerMethod · 0.95
startNewConnectionsMethod · 0.95

Calls 1

nowTsMethod · 0.95

Tested by

no test coverage detected