mirror of
https://github.com/christianselig/apollo-backend
synced 2025-02-16 17:21:21 +00:00
change connections to see if database state improves
This commit is contained in:
parent
badda4f191
commit
f44572f9f8
1 changed files with 3 additions and 3 deletions
|
@ -50,12 +50,12 @@ func NewRedisClient(ctx context.Context) (*redis.Client, error) {
|
||||||
return client, nil
|
return client, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewDatabasePool(ctx context.Context, maxConns int) (*pgxpool.Pool, error) {
|
func NewDatabasePool(ctx context.Context, minConns int) (*pgxpool.Pool, error) {
|
||||||
url := fmt.Sprintf(
|
url := fmt.Sprintf(
|
||||||
"%s?sslmode=require&pool_max_conns=%d&pool_min_conns=%d",
|
"%s?sslmode=require&pool_max_conns=%d&pool_min_conns=%d",
|
||||||
os.Getenv("DATABASE_CONNECTION_POOL_URL"),
|
os.Getenv("DATABASE_CONNECTION_POOL_URL"),
|
||||||
maxConns,
|
minConns*8,
|
||||||
maxConns/8,
|
minConns,
|
||||||
)
|
)
|
||||||
config, err := pgxpool.ParseConfig(url)
|
config, err := pgxpool.ParseConfig(url)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in a new issue