(count int)
| 445 | } |
| 446 | |
| 447 | func (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 | |
| 465 | func (pool *Pool) ping(conn *Conn) error { |
| 466 | deadline := time.Now().Add(100 * time.Millisecond) |
no test coverage detected