Skip to content

Commit 9711a4d

Browse files
authoredDec 15, 2023
Merge pull request #42 from IdrisHanafiTests/hotfix/pool-db-optimization
hotfix: prevent pool_db connections accumulating
2 parents 797d93b + 91a365d commit 9711a4d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed
 

‎pool/pgpoolstorage/policy.go

+2
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ func (p *PostgresPoolStorage) CheckPolicy(ctx context.Context, policy pool.Polic
3434
} else if err != nil {
3535
return false, err
3636
}
37+
38+
defer rows.Close()
3739
if !rows.Next() { // should always be a row if the policy exists
3840
return false, nil
3941
}

0 commit comments

Comments
 (0)
Please sign in to comment.