fix(tradein/cian): rename counter to price_changes_attempted + cap batch_size <=200
This commit is contained in:
parent
6851c55090
commit
e77bc9fe06
2 changed files with 5 additions and 5 deletions
|
|
@ -1029,7 +1029,7 @@ class CianBackfillResp(BaseModel):
|
|||
listings_succeeded: int
|
||||
listings_failed_fetch: int
|
||||
listings_failed_save: int
|
||||
price_changes_inserted: int
|
||||
price_changes_attempted: int
|
||||
houses_total: int
|
||||
houses_processed: int
|
||||
houses_succeeded: int
|
||||
|
|
@ -1040,7 +1040,7 @@ class CianBackfillResp(BaseModel):
|
|||
|
||||
@router.post("/scrape/cian-backfill-history", response_model=CianBackfillResp)
|
||||
async def scrape_cian_backfill_history(
|
||||
batch_size: int = 50,
|
||||
batch_size: int = Query(50, ge=1, le=200),
|
||||
do_listings: bool = True,
|
||||
do_houses: bool = True,
|
||||
dry_run: bool = False,
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ class CianBackfillResult:
|
|||
listings_succeeded: int = 0
|
||||
listings_failed_fetch: int = 0
|
||||
listings_failed_save: int = 0
|
||||
price_changes_inserted: int = 0
|
||||
price_changes_attempted: int = 0
|
||||
houses_total: int = 0
|
||||
houses_processed: int = 0
|
||||
houses_succeeded: int = 0
|
||||
|
|
@ -130,7 +130,7 @@ async def backfill_cian_history(
|
|||
try:
|
||||
save_detail_enrichment(db, listing_id, enrichment)
|
||||
result.listings_succeeded += 1
|
||||
result.price_changes_inserted += len(enrichment.price_changes or [])
|
||||
result.price_changes_attempted += len(enrichment.price_changes or [])
|
||||
except Exception as exc:
|
||||
logger.warning(
|
||||
"cian_detail save failed for listing_id=%s: %s", listing_id, exc
|
||||
|
|
@ -161,7 +161,7 @@ async def backfill_cian_history(
|
|||
result.listings_succeeded,
|
||||
result.listings_failed_fetch,
|
||||
result.listings_failed_save,
|
||||
result.price_changes_inserted,
|
||||
result.price_changes_attempted,
|
||||
result.houses_processed,
|
||||
result.houses_total,
|
||||
result.houses_succeeded,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue