Skip to content

Commit f09c3fa

Browse files
Call check() before querying PG connection pool
check() checks that none of the connections in the pool have gone bad and if they have replaces them
1 parent 911bcfa commit f09c3fa

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

src/nypl_py_utils/classes/postgresql_client.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ def execute_query(self, query, is_write_query=False, query_params=None,
7373
"""
7474
self.logger.info('Querying {} database'.format(self.db_name))
7575
self.logger.debug('Executing query {}'.format(query))
76+
self.pool.check()
7677
with self.pool.connection() as conn:
7778
try:
7879
conn.row_factory = row_factory

0 commit comments

Comments
 (0)