alumni_lookup

Scheduled Jobs

Last Updated: 2026-01-18
Purpose: Single source of truth for recurring scheduled tasks (Heroku Scheduler)


Heroku Scheduler Limitation

⚠️ 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?

Active Schedules

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

Pending Schedules (Pre-MVP)

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:


Heroku Scheduler Activation Commands

  1. Open app in Heroku Dashboard
  2. Go to Resources tab
  3. Click Heroku Scheduler add-on
  4. Click Create job for each pending schedule

Via Heroku CLI

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.

Testing Jobs Manually (Staging)

# 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

Scheduler Owner


How to Update

  1. Open the Heroku Scheduler add-on.
  2. Add or update the command + schedule.
  3. Update this document to keep the list current.