From 4dcb9c969e5a2b9ea14717cfd45c5bd438a9416e Mon Sep 17 00:00:00 2001 From: "Bobby (aider)" Date: Sat, 8 Feb 2025 20:27:33 -0800 Subject: [PATCH] fix: Disable session checking and optimize ClickHouse client config --- src/db/db_connection.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/db/db_connection.py b/src/db/db_connection.py index 19d34a8..dc842e7 100644 --- a/src/db/db_connection.py +++ b/src/db/db_connection.py @@ -14,7 +14,7 @@ logger = logging.getLogger(__name__) def create_client(): """ - Create a ClickHouse client with retry logic but without session management + Create a ClickHouse client without session management """ clickhouse_password = os.getenv("CLICKHOUSE_PASSWORD") if not clickhouse_password: @@ -34,13 +34,18 @@ def create_client(): password=clickhouse_password, secure=True, connect_timeout=10, - send_receive_timeout=300 + send_receive_timeout=300, + query_limit=0, # No query limit + compress=True, # Enable compression + settings={ + 'session_check': 0 # Disable session checking + } ) # Test the connection with a simple query try: client.query('SELECT 1') - logger.info(f"Successfully established connection") + logger.debug(f"Successfully established connection") # Changed to debug level return client except Exception as e: logger.error(f"Connection test failed: {str(e)}")