feat(scraper-kit): copy scheduler with registry-dispatch (25+ trigger_* → dict), strangler (#2136) #2182
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#2182
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "feat/scraper-kit-scheduler-copy"
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?
Закрывает #2136 (Epic #2126, шаг G — последний инертный шаг переноса). Strangler — боевые
app/services/scheduler.py+app/scheduler_main.pyНЕ тронуты, деплой инертен.Скопировано в
scraper_kit/orchestration/scheduler.py(694 стр)Развязка от app.* (0 импортов, AST-guard зелёный).
Registry-dispatch (убил copy-paste)
Handler(frozen dataclass):job+log_name+ опц.pre_claim(гейт, напр. cian cookie-check→defer) +post_claim(напр. proxy_healthcheck sub-hourly reschedule)SchedulerContext: инжектconfig/matcher/enrichment/session_factory/shutdown_requested/runs+_inflight_tasks(#1182 SIGTERM-drain)_dispatch()— единый путь:pre_claim → _claim_run → post_claim → spawn. Заменяет весь per-handler boilerplatebuild_registry(product_handlers)— 8 kit-native sweep + инжектируемые продуктовые callbacks;resolve_handlerexact + wildcard-префикс (deactivate_stale_*)def trigger_*_run=0,elif source===0,_dispatch=1_claim_run(advisory-lock + double-check + rollback),reap_zombies(6h),compute_next_run_at, heartbeat/drainGolden-parity ✅ (45 тестов)
scheduler_loop(trigger'ы замоканы) vs kitresolve_handler→ эквивалентная таблица маршрутизации (вкл. dead deactivate_stale routing)Verify
from appв kit пустоОстаток (rewire, отдельно)
Продуктовые handler'ы (rosreestr/sber/deactivate/*_backfill/cadastral/cian-cookie/proxy_healthcheck — тело в app) строятся при runtime-wiring (
build_registry(product_handlers=...)) — поздний rewire-шаг. Боевой контейнер по-прежнему на старом scheduler.