Skip to content

Commit

Permalink
Adding keepalive settings for Redshift (#5433)
Browse files Browse the repository at this point in the history
  • Loading branch information
galvana authored Oct 29, 2024
1 parent 4af14dc commit 6db9bbc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ The types of changes are:

### Added
- Added DataHub integration config [#5401](https://github.com/ethyca/fides/pull/5401)
- Added keepalive settings to the Redshift integration [#5433](https://github.com/ethyca/fides/pull/5433)

### Developer Experience
- Added Carbon Icons to FidesUI [#5416](https://github.com/ethyca/fides/pull/5416)
Expand Down
9 changes: 8 additions & 1 deletion src/fides/api/service/connectors/sql_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -499,8 +499,15 @@ def build_uri(self) -> str:
# Overrides SQLConnector.create_client
def create_client(self) -> Engine:
"""Returns a SQLAlchemy Engine that can be used to interact with a database"""
connect_args = {}
connect_args: Dict[str, Union[int, str]] = {}
connect_args["sslmode"] = "prefer"

# keep alive settings to prevent long-running queries from causing a connection close
connect_args["keepalives"] = 1
connect_args["keepalives_idle"] = 30
connect_args["keepalives_interval"] = 5
connect_args["keepalives_count"] = 5

if (
self.configuration.secrets
and self.configuration.secrets.get("ssh_required", False)
Expand Down

0 comments on commit 6db9bbc

Please sign in to comment.