Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
jmeunier28 committed Jul 14, 2023
1 parent 672022a commit ecb2bbc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
10 changes: 5 additions & 5 deletions postgres/datadog_checks/postgres/connections.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ def __str__(self):
class ConnectionInfo:
def __init__(
self,
connection: psycopg2.extensions.connection,
deadline: int,
connection: psycopg.Connection,
deadline: datetime,
active: bool,
last_accessed: int,
last_accessed: datetime,
thread: threading.Thread,
):
self.connection = connection
Expand Down Expand Up @@ -79,7 +79,7 @@ def __init__(self, connect_fn: Callable[[str], None], max_conns: int = None):
)
self.connect_fn = connect_fn

def _get_connection_raw(self, dbname: str, ttl_ms: int, timeout: int = None) -> psycopg2.extensions.connection:
def _get_connection_raw(self, dbname: str, ttl_ms: int, timeout: int = None) -> psycopg.Connection:
"""
Return a connection from the pool.
"""
Expand Down Expand Up @@ -183,6 +183,6 @@ def _terminate_connection_unsafe(self, dbname: str):
db.close()
except Exception:
self._stats.connection_closed_failed += 1
self._log.exception("failed to close DB connection for db=%s", dbname)
self.log.exception("failed to close DB connection for db=%s", dbname)
return False
return True
1 change: 0 additions & 1 deletion postgres/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ deps = [
"cachetools==5.3.1; python_version > '3.0'",
"psycopg[binary]==3.1.9; python_version > '3.0'",
"semver==3.0.1; python_version > '3.0'",
"psycopg[pool]==3.1.7; python_version > '3.0'",
]

[project.urls]
Expand Down

0 comments on commit ecb2bbc

Please sign in to comment.