mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
do the database write
This commit is contained in:
parent
da34b99251
commit
df6c42933a
1 changed files with 9 additions and 9 deletions
|
|
@ -32,17 +32,17 @@ class ConditionPostgres:
|
||||||
|
|
||||||
with db_session() as session:
|
with db_session() as session:
|
||||||
logger.info("[ConditionPostgres] Successfully made connection to database")
|
logger.info("[ConditionPostgres] Successfully made connection to database")
|
||||||
# for start in range(0, total, batch_size):
|
for start in range(0, total, batch_size):
|
||||||
# end = min(start + batch_size, total)
|
end = min(start + batch_size, total)
|
||||||
# batch = survey_models[start:end]
|
batch = survey_models[start:end]
|
||||||
|
|
||||||
# t0: float = time.perf_counter()
|
t0: float = time.perf_counter()
|
||||||
# ConditionPostgres._insert_surveys_batch(batch, session)
|
ConditionPostgres._insert_surveys_batch(batch, session)
|
||||||
# elapsed: float = time.perf_counter() - t0
|
elapsed: float = time.perf_counter() - t0
|
||||||
|
|
||||||
# logger.info(
|
logger.info(
|
||||||
# f"Inserted batch {start} - {end} ({len(batch)} surveys) in {elapsed} seconds",
|
f"Inserted batch {start} - {end} ({len(batch)} surveys) in {elapsed} seconds",
|
||||||
# )
|
)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def map_survey_to_model(
|
def map_survey_to_model(
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue