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

Method startNewConnections

IceFireDB-SQLProxy/pkg/mysql/client/pool.go:449–469  ·  view source on GitHub ↗
(count int)

Source from the content-addressed store, hash-verified

447}
448
449func (pool *Pool) startNewConnections(count int) error {
450 connections := make([]Connection, 0, count)
451 for i := 0; i < count; i++ {
452 conn, err := pool.createNewConnection()
453 if err != nil {
454 return err
455 } else {
456 pool.synchro.Lock()
457 pool.synchro.stats.TotalCount++
458 pool.synchro.Unlock()
459 connections = append(connections, conn)
460 }
461 }
462
463 pool.synchro.Lock()
464 for _, connection := range connections {
465 pool.putConnectionUnsafe(connection)
466 }
467 pool.synchro.Unlock()
468 return nil
469}
470
471func (pool *Pool) ping(conn *Conn) error {
472 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