From 507621290a2426ca72d35c509393e33bb70e8f9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Szczur?= Date: Thu, 9 Jan 2025 23:06:22 +0100 Subject: [PATCH] feat(clickhouse): when HTTP pass ca_cert and verify to pool manager (#27399) --- posthog/clickhouse/client/connection.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/posthog/clickhouse/client/connection.py b/posthog/clickhouse/client/connection.py index 1769af54d59ab..1b3028aeb9353 100644 --- a/posthog/clickhouse/client/connection.py +++ b/posthog/clickhouse/client/connection.py @@ -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, ) @@ -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,