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

Method startNewConnections

IceFireDB-SQLite/pkg/mysql/client/pool.go:447–463  ·  view source on GitHub ↗
(count int)

Source from the content-addressed store, hash-verified

445}
446
447func (pool *Pool) startNewConnections(count int) {
448 connections := make([]Connection, 0, count)
449 for i := 0; i < count; i++ {
450 if conn, err := pool.createNewConnection(); err == nil {
451 pool.synchro.Lock()
452 pool.synchro.stats.TotalCount++
453 pool.synchro.Unlock()
454 connections = append(connections, conn)
455 }
456 }
457
458 pool.synchro.Lock()
459 for _, connection := range connections {
460 pool.putConnectionUnsafe(connection)
461 }
462 pool.synchro.Unlock()
463}
464
465func (pool *Pool) ping(conn *Conn) error {
466 deadline := time.Now().Add(100 * time.Millisecond)

Callers 2

NewPoolFunction · 0.95

Calls 2

createNewConnectionMethod · 0.95
putConnectionUnsafeMethod · 0.95

Tested by

no test coverage detected