From 91a365d7dd6590cd9fe866604c2229b4c3be1ff8 Mon Sep 17 00:00:00 2001 From: Idris Hanafi Date: Thu, 14 Dec 2023 19:29:50 -0500 Subject: [PATCH] hotfix: prevent pool_db connections accumulating Same PR as https://github.com/0xPolygon/cdk-validium-node/pull/30 --- pool/pgpoolstorage/policy.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pool/pgpoolstorage/policy.go b/pool/pgpoolstorage/policy.go index 4d3e8bdbc8..89fd610f4d 100644 --- a/pool/pgpoolstorage/policy.go +++ b/pool/pgpoolstorage/policy.go @@ -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 }