Skip to content

Commit

Permalink
use main thread db connection
Browse files Browse the repository at this point in the history
  • Loading branch information
jmeunier28 committed Aug 7, 2023
1 parent 375fe2e commit 8664978
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion postgres/datadog_checks/postgres/postgres.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,10 @@ def _new_query_executor(self, queries):
)

def execute_query_raw(self, query):
return self.db_pool.execute_main_db_safe(query)
with self.db.cursor() as cursor:
cursor.execute(query)
rows = cursor.fetchall()
return rows

@property
def dynamic_queries(self):
Expand Down

0 comments on commit 8664978

Please sign in to comment.