From 290ec33a8424666ef568089768f698b3cf3835f2 Mon Sep 17 00:00:00 2001 From: garrettladley Date: Tue, 23 Jan 2024 14:10:30 -0500 Subject: [PATCH] increase num open connections in ghwf --- .github/workflows/go.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 5eb9cb145..56bd4e3f5 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -59,7 +59,6 @@ jobs: POSTGRES_DB: sac ports: - 5432:5432 - steps: - name: Checkout Repository uses: actions/checkout@v3 @@ -69,11 +68,15 @@ jobs: go-version: "1.21" - name: Install Dependencies run: cd backend && go get ./... + - name: Wait for PostgreSQL to become ready + run: until pg_isready -h 127.0.0.1 -p 5432 -U postgres; do sleep 1; done - name: Increase max_connections in PostgreSQL run: | - PG_CONFIG_FILE=$(psql -U postgres -c "SHOW config_file;" -tA) + PG_CONFIG_FILE=$(psql -h 127.0.0.1 -p 5432 -U postgres -c "SHOW config_file;" -tA) sudo sed -i "s/^#max_connections = 100/max_connections = 200/" $PG_CONFIG_FILE sudo systemctl reload postgresql + env: + PGPASSWORD: password - name: Migrate DB run: cd backend/src && go run main.go --only-migrate - name: Run Tests with Coverage