scraper-kit G: scheduler + registry-dispatch (25+ trigger_* → dict-реестр) #2136

Closed
opened 2026-07-02 13:40:50 +00:00 by lekss361 · 0 comments
Owner

Часть Epic #2126, шаг G. Depends: шаг F (pipeline-move). Активировать после merge F.

Goal

Переместить scheduler.py (1810) + scrape_runs.py в scraper_kit.orchestration. Заменить 25+ copy-paste trigger_*_run (scheduler.py:342-1718) + 27-веточный if/elif dispatch (scheduler.py:1754-1805) на provider-registry (dict source→handler). scheduler_main.py в продукте → тонкий entrypoint, конструирующий kit-scheduler с инжектами.

Files

  • packages/scraper-kit/src/scraper_kit/orchestration/{scheduler,runs,registry}.py
  • tradein-mvp/backend/app/scheduler_main.py (переписать на entrypoint)

Acceptance

  • docker exec tradein-scraper python -c "import scraper_kit.orchestration" OK (после деплоя)
  • Smoke по КАЖДОМУ source: UPDATE scrape_schedules SET next_run_at=now() WHERE source='<X>' → run подхватывается ≤60s
  • trigger_* схлопнуты в реестр (grep)

Risk

Самый рискованный move — регресс тихо ломает scheduled-скрейп (виден только на проде). Advisory-lock claim + zombie-reaper сохранить дословно. Post-deploy smoke по всем source.

Agent: backend-engineer

Часть Epic #2126, шаг G. ⛔ Depends: шаг F (pipeline-move). Активировать после merge F. ## Goal Переместить `scheduler.py` (1810) + `scrape_runs.py` в `scraper_kit.orchestration`. Заменить 25+ copy-paste `trigger_*_run` (`scheduler.py:342-1718`) + 27-веточный if/elif dispatch (`scheduler.py:1754-1805`) на **provider-registry** (dict source→handler). `scheduler_main.py` в продукте → тонкий entrypoint, конструирующий kit-scheduler с инжектами. ## Files - `packages/scraper-kit/src/scraper_kit/orchestration/{scheduler,runs,registry}.py` - `tradein-mvp/backend/app/scheduler_main.py` (переписать на entrypoint) ## Acceptance - `docker exec tradein-scraper python -c "import scraper_kit.orchestration"` OK (после деплоя) - Smoke по КАЖДОМУ source: `UPDATE scrape_schedules SET next_run_at=now() WHERE source='<X>'` → run подхватывается ≤60s - `trigger_*` схлопнуты в реестр (grep) ## Risk Самый рискованный move — регресс тихо ломает scheduled-скрейп (виден только на проде). Advisory-lock claim + zombie-reaper сохранить дословно. Post-deploy smoke по всем source. **Agent:** backend-engineer
lekss361 added the
priority/p2
scope/backend
scrapers
tech-debt
tradein
labels 2026-07-02 13:41:57 +00:00
lekss361 added the
status/ready
status/wip
labels 2026-07-02 17:29:23 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: lekss361/gendesign#2136
No description provided.