Skip to content

Commit

Permalink
Merge pull request #42 from IdrisHanafiTests/hotfix/pool-db-optimization
Browse files Browse the repository at this point in the history
hotfix: prevent pool_db connections accumulating
  • Loading branch information
arnaubennassar authored Dec 15, 2023
2 parents 797d93b + 91a365d commit 9711a4d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pool/pgpoolstorage/policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ func (p *PostgresPoolStorage) CheckPolicy(ctx context.Context, policy pool.Polic
} else if err != nil {
return false, err
}

defer rows.Close()
if !rows.Next() { // should always be a row if the policy exists
return false, nil
}
Expand Down

0 comments on commit 9711a4d

Please sign in to comment.