From b026a7ae9e7d8f97037e9c2a2a9653e212f8ff12 Mon Sep 17 00:00:00 2001 From: Daniel Roth Date: Tue, 10 Feb 2026 09:02:44 +0000 Subject: [PATCH] log db session but dont write to db --- .../persistence/condition_postgres.py | 19 ++++++++++--------- backend/condition/processor.py | 4 ++-- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/backend/condition/persistence/condition_postgres.py b/backend/condition/persistence/condition_postgres.py index 9d7895f0..9b9ce2e0 100644 --- a/backend/condition/persistence/condition_postgres.py +++ b/backend/condition/persistence/condition_postgres.py @@ -31,17 +31,18 @@ class ConditionPostgres: ) with db_session() as session: - for start in range(0, total, batch_size): - end = min(start + batch_size, total) - batch = survey_models[start:end] + logger.info("Successfully made connection to database:", session) + # for start in range(0, total, batch_size): + # end = min(start + batch_size, total) + # batch = survey_models[start:end] - t0: float = time.perf_counter() - ConditionPostgres._insert_surveys_batch(batch, session) - elapsed: float = time.perf_counter() - t0 + # t0: float = time.perf_counter() + # ConditionPostgres._insert_surveys_batch(batch, session) + # elapsed: float = time.perf_counter() - t0 - logger.info( - f"Inserted batch {start} - {end} ({len(batch)} surveys) in {elapsed} seconds", - ) + # logger.info( + # f"Inserted batch {start} - {end} ({len(batch)} surveys) in {elapsed} seconds", + # ) @staticmethod def map_survey_to_model( diff --git a/backend/condition/processor.py b/backend/condition/processor.py index 650442aa..b7c7d2b6 100644 --- a/backend/condition/processor.py +++ b/backend/condition/processor.py @@ -43,6 +43,6 @@ def process_file( f"[processor] Finished mapping {len(property_condition_surveys)} properties. Writing to database..." ) - # persistence.bulk_insert_surveys(property_condition_surveys) + persistence.bulk_insert_surveys(property_condition_surveys) - # logger.info(f"[processor] Finished loading surveys to database") + logger.info(f"[processor] Finished loading surveys to database")