Last Updated: 2026-01-18
Purpose: Single source of truth for recurring scheduled tasks (Heroku Scheduler)
⚠️ Heroku Scheduler only supports: Every 10 minutes, Every hour at…, Every day at…
No weekly option exists. For weekly jobs, schedule DAILY and add a Monday guard in the job code:
return unless Time.zone.today.monday?
| Job | Command | Schedule | Notes |
|---|---|---|---|
| Session cleanup | bin/rails rake maintenance:cleanup_sessions |
Daily at 6:00 AM Central | Removes stale sessions |
| Message notifications | bin/rails runner "MessageNotificationJob.perform_now" |
Every 10 minutes | Sends Champion message email notifications |
| Champion weekly digest | bin/rails runner "Cp::WeeklyDigestJob.perform_now" |
Daily (Monday guard in code) | Staff-facing metrics summary — only sends on Mondays |
These jobs have code/tests ready but need to be added to Heroku Scheduler before launch.
| Job | Command | Schedule | Notes |
|---|---|---|---|
| Notification daily digest | bin/rails runner "Cp::NotificationDigestJob.perform_now(digest_type: 'daily')" |
Daily at 7:00 AM Central | Champion notification email digest |
| Notification weekly digest | bin/rails runner "Cp::NotificationDigestJob.perform_now(digest_type: 'weekly')" |
Daily (Monday guard in code) | Champion weekly notification email digest |
Notes on timezone:
Add Scheduler add-on (if not already installed):
heroku addons:create scheduler:standard --app alumni-lookup
Open Scheduler to add jobs:
heroku addons:open scheduler --app alumni-lookup
Add these jobs in the Scheduler UI:
| Job Name | Command | Dyno Size | Frequency | Time (UTC) |
|---|---|---|---|---|
| Daily Notification Digest | bin/rails runner "Cp::NotificationDigestJob.perform_now(digest_type: 'daily')" |
Basic | Daily | 12:00 PM |
| Weekly Notification Digest | bin/rails runner "Cp::NotificationDigestJob.perform_now(digest_type: 'weekly')" |
Basic | Daily | 12:30 PM |
Note: The weekly digest has a Monday guard in the code, so it will skip on non-Mondays even though scheduled daily.
# Test daily digest
heroku run 'bin/rails runner "Cp::NotificationDigestJob.perform_now(digest_type: \"daily\")"' --app alumni-lookup-staging
# Test weekly digest (will only send on Mondays)
heroku run 'bin/rails runner "Cp::NotificationDigestJob.perform_now(digest_type: \"weekly\")"' --app alumni-lookup-staging
# Force weekly digest on any day (for testing only - bypass Monday guard)
heroku run 'bin/rails runner "Cp::NotificationDigestJob.new.send(:send_weekly_digests)"' --app alumni-lookup-staging