fix(tradein): persist scrape_runs.total_seen/new_count from sweep counters (#1926) #1928
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#1928
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "fix/1926-scrape-total-seen"
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?
Root (audit #1871/#1926): city-sweep counters (yandex/avito/cian/domclick/newbuilding) писали
lots_fetched/lots_insertedтолько вscrape_runs.countersjsonb; колонкиtotal_seen/new_count(схема 015) не выставлялись → observability показывалаtotal_seen=0при реально сохранённых строках («observability врёт»).Fix (Option A — одно место, все источники): helper
_column_counts()вscrape_runs.pyмапитlots_fetched→total_seen,lots_inserted→new_count(явные ключи приоритетнее).update_heartbeat/mark_done/mark_failed/mark_bannedSET-ят обе колонки черезCOALESCE(CAST(:x AS int), col)(psycopg v3) — отсутствие ключа сохраняет старое значение. Покрывает yandex+avito+cian (+domclick/newbuilding), т.к. все пайплайны идут через эти финализаторы. Без миграции (колонки уже есть).Tests: +6 в
test_city_sweep.py; полный сьют 2419 passed, 0 failed (с 2 known-flaky deselect). ruff clean.Refs #1926, #1871