Skip to content

Improve reliability of scheduled event publish cron (~every 5 minutes) #34

Description

@akhilk999

Summary

GitHub Actions runs .github/workflows/publish-scheduled-events.yml on */5 * * * * to call /api/cron/publish-events and publish due scheduled events. The job is intended to poll about every 5 minutes, but GitHub's scheduler is best-effort, not guaranteed.

Observed behavior

  • Manual workflow_dispatch runs work after the middleware /api/cron allowlist fix.
  • Automatic schedule runs do fire, but not reliably every 5 minutes.
  • Example: after a successful schedule run at 2026-07-17T00:06:55Z, roughly six expected */5 ticks (~00:10–00:35 UTC) did not produce additional schedule runs (~30 minutes with no automatic poll).

Impact

  • Officers can schedule an event for time T, but it may publish several minutes (or longer) after publish_at.
  • Empty polls ({"published":0}) are fine when they do run; the problem is missed / delayed schedule ticks.

Context / constraints

  • Vercel Hobby only allows ~1 cron/day, so we moved polling to GitHub Actions.
  • Keepalive job was added to reduce 60-day public-repo schedule dormancy risk; that does not fix tick reliability.

Possible directions

  1. Monitor schedule gaps (alert if no schedule run for N minutes).
  2. Use an external scheduler (e.g. cron-job.org) hitting the same authenticated endpoint.
  3. Move to Vercel Pro cron if we want platform-side minute accuracy.
  4. Document expected "publish within ~5–15+ minutes after publish_at" for officers.

Acceptance criteria

  • Documented expected publish delay / reliability for scheduled events
  • Chosen mitigation (monitor, external cron, and/or Vercel Pro) implemented or explicitly deferred
  • Verification that automatic publishes happen close enough to publish_at for CSA ops needs

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions