feat(tradein): yandex city sweep — EKB-center rooms×price combos (replaces 5-anchor shallow) #1658
No reviewers
Labels
No labels
admin
analytics
auth
automation
bug
business
chore
ci
compliance
data
data-moat
docs
duplicate
dx
enhancement
Fable 5 ревью
feedback/max
generative
GG-форсайт
needs-discussion
needs-human
observability
pause-bots
performance
priority/p0
priority/p1
priority/p2
priority/p3
scope/backend
scope/db
scope/devops
scope/frontend
scope/qa
scrapers
security
site-finder
stage/1
stage/2
status/blocked
status/done
status/needs-analysis
status/needs-fix
status/qa
status/ready
status/review
status/wip
tech-debt
tradein
ux
week ревью 1
wontfix
вторичка
ИРД
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: lekss361/gendesign#1658
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "feat/yandex-center-rooms-price-sweep"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Replaces the narrow nightly yandex sweep (5 geographic anchors × 2 pages, ~50 lots/run) with an EKB-center rooms×price exhaustive sweep.
Problem
yandex_city_sweepiteratedEKB_ANCHORS(5 points, 1.5km radius each) ×pages_per_anchor=2— geographically narrow + shallow → only ~48 of 3969 active yandex listings refreshed within 14 days.Fix
run_yandex_city_sweepnow calls the existingYandexRealtyScraper.fetch_around_multi_roomin combos mode on the EKB center (56.8400, 60.6050): all 5 room types ×DEFAULT_PRICE_RANGES(6 buckets) = 30 combos, which bypasses the SERP ~575-card cap via price/room segmentation. Covers the whole city from one center instead of 5 small circles.(56.8400, 60.6050);radius_mdefault raised1500 → 25000(city-scale; Yandex SERP is path/city-scoped so geo-bbox is secondary).EKB_ANCHORSunchanged — avito/cian sweeps still use the 5-anchor path. Only yandex changed.CitySweepCountersfields unchanged (anchors_total=1for the center run).trigger_yandex_city_sweep_rununchanged (pages_per_anchor→max_pages).119_yandex_city_sweep_center_combos.sql: updates yandex scheduledefault_params(radius_m=25000, pages_per_anchor=3); rooms/price use code defaults (ROOM_PATH.keys()+DEFAULT_PRICE_RANGES).Test plan
test_prod_mode_uses_center_anchor_with_combos+ back-compat test for explicit anchors)next_run=now→ expect lots_fetched ≫ ~50 (30 combos)Note: new code can't be smoked on prod until deployed — verified statically + via unit tests.
Refs #759
Deep review verdict: APPROVE.
Merging squash.
Post-deploy smoke (run #103, prod, new combos code) — REGRESSION FOUND.
The new center-combos sweep hits the per-anchor watchdog ANCHOR_TIMEOUT_SEC=240s. In the old model each of 5 anchors had its own 240s budget; the new model wraps ALL 30 combos (5 rooms x 6 price_ranges) + address-enrich in a SINGLE 240s asyncio.wait_for (scrape_pipeline.py:957). 30 combos x ~30s each (9s inter-request delay + page fetch) cannot finish in 240s.
Result run #103: status=done, lots_fetched=0, errors_count=1, 'anchor #1/1 timed out after 240s — skipping'. The partial seen-dict is discarded on timeout (fetch_around_multi_room never returns), so 0 lots saved. Compare run #102 (old code, same trigger): lots_fetched=23.
Proof the combos logic itself works: log showed 'rooms=1 price=[None-5000000]: 20 cards' right before the watchdog killed it. Studio price buckets legitimately returned 0.
Why offline tests passed: they mock fetch_around_multi_room to return instantly, bypassing the watchdog entirely. The timing interaction is only observable on real network.
FOLLOW-UP NEEDED (new PR): either (a) raise/parametrize ANCHOR_TIMEOUT_SEC for the yandex combos path (needs ~30*30=900s+), (b) make fetch_around_multi_room return partial seen-dict on a soft deadline, or (c) wrap each combo (not the whole sweep) in its own watchdog. Prod schedule restored (window 2-5, next_run 2026-06-17 02:00); the nightly run will produce ~0 lots until this is fixed.
Deploy note: deploy-tradein selectively skips scraper recreate on backend-only changes (#1182), so the scraper ran STALE code on first trigger (run #102); I force-recreated the scraper service to get the new code live for this smoke.