# Weekly FMCSA trucking-source refresh. Re-ingests the full FMCSA motor-carrier
# census from the live Socrata API and re-runs enrichment -> flagging ->
# verification -> MX-tagging, so the daily campaign builders automatically catch
# carriers who NEWLY fell out of compliance (e.g. an MCS-150 update that just
# lapsed) and drop carriers who have since refiled. Idempotent + incremental:
# the upsert preserves email_verified / listmonk_sent_at / deficiency_flags, so
# existing carriers keep their send state and only census fields refresh; new
# DOTs flow into verification then campaigns. The original census load was a
# one-time snapshot with no refresh timer -- this closes that gap. Runs Sunday
# 09:00 UTC (off-peak, well before Monday's 08:00 UTC trucking builder).
# Takes a while (full ~2M-row download + verify batch), so it runs off-peak.
0 9 * * 0 deploy cd /opt/performancewest && docker compose exec -T workers python3 -m scripts.workers.fmcsa_source_refresh >> /opt/performancewest/logs/pw-fmcsa-refresh.log 2>&1
