- Add POST /admin/jobs/run-daily-snapshots (replaces 24h setInterval in server/snapshots.ts) - Add POST /admin/jobs/sync-and-simulate (syncs standings every 2h; only simulates when standings actually changed by comparing gamesPlayed + leagueRank before upserting) - Add standingsLastChangedAt + lastSimulatedAt columns to sportsSeasons (migration 0118) - Add GET /healthz route for Docker healthcheck (pings DB, returns 503 on failure) - Add app/lib/cron-auth.ts shared X-Cron-Secret header auth helper - Remove startSnapshotSystem() from server/socket.ts (no more in-process setInterval) - Add Forgejo Actions scheduled workflows: daily-snapshots.yml (00:05 UTC) and sync-and-simulate.yml (every 2h) — require CRON_SECRET repo secret Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
15 lines
384 B
YAML
15 lines
384 B
YAML
name: Daily snapshots
|
|
on:
|
|
schedule:
|
|
- cron: '5 0 * * *'
|
|
|
|
jobs:
|
|
run:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Create daily standings snapshots
|
|
run: |
|
|
curl -sf -X POST https://brackt.com/admin/jobs/run-daily-snapshots \
|
|
-H "X-Cron-Secret: ${{ secrets.CRON_SECRET }}" \
|
|
-H "Content-Type: application/json" \
|
|
| cat
|