mirror of https://github.com/jackc/pgx.git
Start pgxpool background health check after initial connections
Otherwise the health check and the create initial connection(s) may both create connections. While this generally wouldn't be a real problem it did cause TestPoolBackgroundChecksMinConns to flicker on CI.pull/1116/head
parent
a55e88ee48
commit
058f346079
|
@ -222,8 +222,6 @@ func ConnectConfig(ctx context.Context, config *Config) (*Pool, error) {
|
|||
config.MaxConns,
|
||||
)
|
||||
|
||||
go p.backgroundHealthCheck()
|
||||
|
||||
if !config.LazyConnect {
|
||||
if err := p.createIdleResources(ctx, int(p.minConns)); err != nil {
|
||||
// Couldn't create resources for minpool size. Close unhealthy pool.
|
||||
|
@ -240,6 +238,8 @@ func ConnectConfig(ctx context.Context, config *Config) (*Pool, error) {
|
|||
res.Release()
|
||||
}
|
||||
|
||||
go p.backgroundHealthCheck()
|
||||
|
||||
return p, nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue