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)}")