From 3865a642f42f8a32630b8f99241756a4b0a892f2 Mon Sep 17 00:00:00 2001 From: Eduardo Cuducos <4732915+cuducos@users.noreply.github.com> Date: Sun, 3 Nov 2024 09:59:43 -0500 Subject: [PATCH] Adds a minimum of one connection to Postgres pool --- db/postgres.go | 1 + 1 file changed, 1 insertion(+) diff --git a/db/postgres.go b/db/postgres.go index 0ccfd92..804d04a 100644 --- a/db/postgres.go +++ b/db/postgres.go @@ -185,6 +185,7 @@ func NewPostgreSQL(uri, schema string, nr *newrelic.Application) (PostgreSQL, er return PostgreSQL{}, fmt.Errorf("could not create database config: %w", err) } cfg.MaxConns = 128 + cfg.MinConns = 1 cfg.MaxConnIdleTime = 5 * time.Minute cfg.MaxConnLifetime = 30 * time.Minute if nr != nil {