trucking campaigns: daily builder + MX verifier concurrency + tracking column

- build_trucking_campaigns.py: nightly script that creates 8 Listmonk campaigns
  per day (4 TZ x 2 types: MCS-150 overdue 2k/TZ, inactive USDOT 1k/TZ)
  at 4AM ET / 5AM ET (CT) / 6AM ET (MT) / 7AM ET (PT). Deduplicates via
  listmonk_sent_at column.
- migration 083: add listmonk_sent_at + listmonk_campaign_type to fmcsa_carriers
- email_verifier.py: bump max_workers from 5 to 20 for 4x faster throughput
- cron: daily pw-trucking-campaigns at 08:00 UTC (3 AM EST)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
justin 2026-05-31 10:07:44 -05:00
parent 54a46062a5
commit 0b7a35a58e
4 changed files with 294 additions and 1 deletions

View file

@ -0,0 +1,10 @@
-- Track which fmcsa_carriers records have been added to Listmonk campaign lists,
-- so the daily campaign builder never double-sends to the same carrier.
ALTER TABLE fmcsa_carriers
ADD COLUMN IF NOT EXISTS listmonk_sent_at TIMESTAMPTZ,
ADD COLUMN IF NOT EXISTS listmonk_campaign_type TEXT;
CREATE INDEX IF NOT EXISTS idx_fmcsa_carriers_listmonk_sent
ON fmcsa_carriers (listmonk_sent_at)
WHERE listmonk_sent_at IS NULL;