feat(tradein/domclick): production Layer B detail-backfill orchestrator (#2000) #2436
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#2436
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "feat/tradein-domclick-layerb-orchestrator"
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
Production scheduled orchestrator for DomClick detail-enrichment (Layer B), porting the manual
POST /scrape/domclick/debug/detail-fetchwiring (session -> cookies -> fetch_detail) into a nightlyscrape_schedulestask. Modeled closely on the provenapp/tasks/avito_detail_backfill.py.app/tasks/domclick_detail_backfill.py-- single-snapshot SELECT (guarantees termination), oneBrowserFetcher(source="domclick")per run via async CM, cookies loaded ONCE viadomclick_session.load_session(db)and threaded into everyfetch_detail(cookies=...). Budget guard + SIGTERM-drain + heartbeat mirror avito.app/services/product_handlers.py(domclick_detail_backfill).data/sql/175_scrape_schedules_seed_domclick_detail_backfill.sql-- seeds scheduleenabled=false(activation is a deliberate separate manual step post-deploy), window 15:00-18:00 UTC (offset from avito 09-12 / yandex 12-15),ON CONFLICT (source) DO NOTHING. Idiom identical to prod-proven migration 112.scraper_kit/providers/domclick/detail.py(QRATOR reputation-block semantics).Naming split (intentional, not a bug):
listings.source = 'domklik'(data identifier, matches Layer Aserp.pyinserts) in the snapshot WHERE clause;BrowserFetcher(source="domclick")(infra identifier -- proxy affinity, cookie tables) for the fetcher. Both correct in their own context.Exception triad:
DomClickBlockedError-> consecutive-block counter -> abort viamark_done(block = expected operational outcome, not a failure);DomClickParseError(schema drift) ->failed++, does NOT trip the block-breaker; other exceptions ->failed+++ rollback + continue.Test plan
tests/tasks/test_domclick_detail_backfill.py).domclick/product_handlers/detail_backfill.CAST(:batch_size AS int), no:x::type).Refs #2000