Request
Two ways to trigger full card regeneration in R2:
- Manual (already exists) —
railway run bash -c "PYTHONPATH=src uv run python -m app.seed_cards --clear" for after major design updates
- Scheduled — runs automatically once a month to pick up new interests from Parliament's register (updated within 28 days of any change)
Implementation options
- Railway cron — add a cron service in Railway that runs
seed_cards on a schedule (e.g. 1st of each month)
- GitHub Actions — scheduled workflow that SSHes into Railway or uses the Railway CLI
- Flask endpoint — add a
POST /admin/seed-cards route protected by a secret key, callable from any cron service
Notes
- The R2 cache key already includes
YYYY-MM so cards expire naturally each month — the scheduled job just pre-warms the cache rather than waiting for user requests to trigger regeneration
seed_cards.py already exists and handles the full regeneration logic
- Should notify (log or Slack) on completion with count of cards generated and any errors
Request
Two ways to trigger full card regeneration in R2:
railway run bash -c "PYTHONPATH=src uv run python -m app.seed_cards --clear"for after major design updatesImplementation options
seed_cardson a schedule (e.g. 1st of each month)POST /admin/seed-cardsroute protected by a secret key, callable from any cron serviceNotes
YYYY-MMso cards expire naturally each month — the scheduled job just pre-warms the cache rather than waiting for user requests to trigger regenerationseed_cards.pyalready exists and handles the full regeneration logic