Edit this page

Scheduled jobs

The jobs that run on a schedule, and how they're moving from in-process cron to Inngest.

Some work happens on a timer: retrying transfers, syncing issue states, reminding contributors. Gitpay runs these jobs in-process with cron today, and is moving them to Inngest one at a time.

The jobs

Job Schedule (server time) What it does
Daily maintenance Every day at 00:00 Retries pending payment request transfers, expires stale PayPal orders, and syncs public stats (unless Inngest owns it).
Sync issue states Every day at 01:00 Reads issue states from GitHub and updates Gitpay.
Sync Whop payouts Every hour Updates payout statuses from Whop.
Weekly bounties Sundays at 08:05 Emails the week’s new bounties.
Latest issues Thursdays at 08:05 Emails the latest issues.
Closed, not paid Sundays at 08:05 Comments on GitHub issues closed with an unpaid bounty.
Unclaimed bounties The 26th of each month Reminds authors of merged pull requests to claim; after two reminders, refunds the sponsors.

Legacy jobs are defined in src/crons/cron.ts.

Inngest

Inngest functions live in src/inngest/functions/ and run inside the API at /api/inngest. Inngest only stores events and state, keeps the schedule, and calls that endpoint.

Function Triggers Replaces
sync-stats cron 0 0 * * * UTC, and the event stats/sync.requested The stats sync in the daily cron

Everything is behind INNGEST_ENABLED:

  • unset or false: /api/inngest isn’t mounted and the legacy cron runs every job;
  • true: Inngest owns the migrated jobs, and the legacy cron skips them, so nothing runs twice.

Run Inngest locally

# .env
INNGEST_ENABLED=true
INNGEST_DEV=1

npm run start:dev
npx inngest-cli@latest dev -u http://localhost:3000/api/inngest

Open http://localhost:8288, find sync-stats under Functions, and invoke it.

Add a function

  1. Create it in src/inngest/functions/, exporting the handler separately so it can be tested with a fake step.
  2. Register it in src/inngest/index.ts.
  3. If it replaces a cron job, skip that job in cron.ts when isInngestEnabled() is true.

New scheduled jobs and lifecycle workflows go in Inngest, not in cron.ts. The full guide is docs/inngest.md.

Next steps