Skip to content

Commit

Permalink
feat(clickhouse): when HTTP pass ca_cert and verify to pool manager (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
orian authored Jan 9, 2025
1 parent b62d9eb commit 5076212
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions posthog/clickhouse/client/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ def __exit__(self, *args):
maxsize=settings.CLICKHOUSE_CONN_POOL_MAX, # max number of open connection per pool
block=True, # makes the maxsize limit per pool, keeps connections
num_pools=12, # number of pools
ca_cert=settings.CLICKHOUSE_CA, # type: ignore[arg-type] # ca_cert default value is None, but the type hint is str instead of Optional[str], https://github.com/ClickHouse/clickhouse-connect/pull/450
verify=settings.CLICKHOUSE_VERIFY,
)


Expand All @@ -71,8 +73,6 @@ def get_http_client(**overrides):
"secure": settings.CLICKHOUSE_SECURE,
"username": settings.CLICKHOUSE_USER,
"password": settings.CLICKHOUSE_PASSWORD,
"ca_cert": settings.CLICKHOUSE_CA,
"verify": settings.CLICKHOUSE_VERIFY,
"settings": {"mutations_sync": "1"} if settings.TEST else {},
# Without this, OPTIMIZE table and other queries will regularly run into timeouts
"send_receive_timeout": 30 if settings.TEST else 999_999_999,
Expand Down

0 comments on commit 5076212

Please sign in to comment.