mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
log db session but dont write to db
This commit is contained in:
parent
cd0ae37d40
commit
b026a7ae9e
2 changed files with 12 additions and 11 deletions
|
|
@ -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(
|
||||
|
|
|
|||
|
|
@ -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")
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue