feat(tradein): nightly task to deactivate stale avito listings (#759) #862

Merged
bot-reviewer merged 1 commit from feat/759-deactivate-stale-avito into main 2026-05-31 07:19:37 +00:00

1 commit

Author SHA1 Message Date
652ea75f54 feat(tradein): nightly task to deactivate stale avito listings (#759)
Avito listings re-seen by the scraper get is_active=true but were never
deactivated when they stop appearing (sold/removed) — unlike cian's snapshot
scope. Result: all avito rows stay is_active=true, inflating the coverage
denominator and polluting estimator analog medians with dead lots.

Add scheduled task deactivate_stale_avito_listings: marks source='avito'
is_active=false when last_seen_at older than AVITO_STALE_TTL_DAYS (10d),
window 06:00-07:00 UTC (after avito_city_sweep). No DELETE — history kept
for backtest #667. cian/yandex untouched. Wired into scheduler_loop dispatch
+ seed migration 090 (ON CONFLICT(source) idempotent).

Refs #759
2026-05-31 10:10:59 +03:00