Fix stdlib
This commit is contained in:
+3
-2
@@ -67,8 +67,9 @@ func OpenFromConnPool(pool *pgx.ConnPool) (*sql.DB, error) {
|
|||||||
// Don't have database/sql immediately release all idle connections because
|
// Don't have database/sql immediately release all idle connections because
|
||||||
// that would mean that prepared statements would be lost (which kills
|
// that would mean that prepared statements would be lost (which kills
|
||||||
// performance if the prepared statements constantly have to be reprepared)
|
// performance if the prepared statements constantly have to be reprepared)
|
||||||
db.SetMaxIdleConns(pool.MaxConnectionCount() - 2)
|
stat := pool.Stat()
|
||||||
db.SetMaxOpenConns(pool.MaxConnectionCount())
|
db.SetMaxIdleConns(stat.MaxConnections - 2)
|
||||||
|
db.SetMaxOpenConns(stat.MaxConnections)
|
||||||
|
|
||||||
return db, nil
|
return db, nil
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user