deep-code-reviewer P0: mark_rate_limited() writes status='rate_limited' but SQL CHECK constraint (015 + 051) only allows banned/done/failed/etc. First blocking event would CheckViolation -> cascade through mark_failed -> runs stuck in 'running' -> zombie cleanup. Frontend never shows badge. Option B fix (no migration): rename mark_rate_limited -> mark_banned, use existing 'banned' status (migration 015 doc'd as 'Avito вернул 403/captcha' - exactly this scenario). Plus: - mark_failed + mark_banned now defensive db.rollback() at start (cascade-safe) - All mark_* now RETURNING id + log warning when no rows updated (M3) - Callers updated: scrape_pipeline.run_avito_city_sweep + test names Refs PR #487 review (deep-code-reviewer, 2026-05-23). |
||
|---|---|---|
| .. | ||
| api | ||
| core | ||
| schemas | ||
| services | ||
| tasks | ||
| __init__.py | ||
| main.py | ||