change min to max conns

This commit is contained in:
Andre Medeiros 2021-07-22 20:50:24 -04:00
parent 45bfa3039c
commit d9b1179717

View file

@ -50,12 +50,12 @@ func NewRedisClient(ctx context.Context) (*redis.Client, error) {
return client, nil return client, nil
} }
func NewDatabasePool(ctx context.Context, minConns int) (*pgxpool.Pool, error) { func NewDatabasePool(ctx context.Context, maxConns int) (*pgxpool.Pool, error) {
url := fmt.Sprintf( url := fmt.Sprintf(
"%s?pool_max_conns=%d&pool_min_conns=%d", "%s?pool_max_conns=%d&pool_min_conns=%d",
os.Getenv("DATABASE_CONNECTION_POOL_URL"), os.Getenv("DATABASE_CONNECTION_POOL_URL"),
minConns*8, maxConns,
minConns, 2,
) )
config, err := pgxpool.ParseConfig(url) config, err := pgxpool.ParseConfig(url)
if err != nil { if err != nil {