Skip to content

Commit

Permalink
increase num open connections in ghwf
Browse files Browse the repository at this point in the history
  • Loading branch information
garrettladley committed Jan 23, 2024
1 parent f96e4b4 commit 197dda8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ jobs:
POSTGRES_DB: sac
ports:
- 5432:5432

steps:
- name: Checkout Repository
uses: actions/checkout@v3
Expand All @@ -68,6 +69,11 @@ jobs:
go-version: "1.21"
- name: Install Dependencies
run: cd backend && go get ./...
- name: Increase max_connections in PostgreSQL
run: |
PG_CONFIG_FILE=$(psql -U postgres -c "SHOW config_file;" -tA)
sudo sed -i "s/^#max_connections = 100/max_connections = 200/" $PG_CONFIG_FILE
sudo systemctl reload postgresql
- name: Migrate DB
run: cd backend/src && go run main.go --only-migrate
- name: Run Tests with Coverage
Expand Down
8 changes: 0 additions & 8 deletions backend/tests/api/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,14 +113,6 @@ func configureDatabase(config config.Settings) (*gorm.DB, error) {
return nil, err
}

sqlDB, err := dbWithDB.DB()

if err != nil {
return nil, err
}

sqlDB.SetMaxOpenConns(100)

return dbWithDB, nil
}

Expand Down

0 comments on commit 197dda8

Please sign in to comment.