Cron Schedule & Tick Times
FactionOps runs five scheduled jobs in the Cloudflare Worker:
| Schedule | Name | What It Runs |
|---|---|---|
*/1 * * * * | 1-minute tick | Energy snapshots, OC Watcher, war/chain broadcasts, retaliation alerts, balance sync, vault verify, banking expiry sweep, wartimeRole sync, premium payment collector |
*/15 * * * * | 15-minute tick | OC collector, OC role automation, OC alert triggers |
0 * * * * | Hourly tick | Gym contributor stats collection, revive skill collection |
5 0 * * * | Nightly (00:05 UTC) | Daily aggregator → cleanup → rollup → contributor daily collection |
0 3 * * SUN | Weekly (03:00 UTC Sunday) | Weekly energy aggregation |
1-Minute Tick Detail
The 1-minute tick runs all real-time collectors sequentially:
| Step | Feature |
|---|---|
| Energy snapshots | Per-member energy bars (members who have supplied a personal API key) |
| Premium payment collector | Reads Roksonic's log for Xanax sends; credits factions |
| War/chain broadcasts | Detects new wars, war ends, and chain milestones; posts to Discord |
| Retaliation alerts | Detects enemy hospitalisations during wars |
| Vault verify | Matches pending withdrawal requests to vault log entries |
| Banking expiry sweep | Auto-cancels expired withdrawal requests |
| Balance sync | Syncs member vault balances from the faction donations endpoint |
| Wartime role sync | Assigns/strips the war-participants Discord role based on poll votes |
| Verification reconcile | Re-syncs Discord roles and nicknames for all linked members. Runs on every 1-minute tick but is 24h-throttled per faction; each faction's reconcile only executes when minute === 7. |
15-Minute Tick Detail
| Step | Feature |
|---|---|
| OC collector | Fetches active OC crimes, enriches slots with item requirements, stores ready_at/CPR/members |
| OC role automation | Syncs difficulty roles (1–10) to current OC assignments; posts bench channel |
| OC alert triggers | Fires CPR, availability, and missing-item alerts |
Data Retention Windows
| Data | Hot Window | Rollup | Delete |
|---|---|---|---|
| Energy snapshots (raw) | 7 days | One row/member/day (is_rollup=1) | After 30 days |
| Contributor stats (hourly) | 7 days | Last row per day | After 30 days |
| Contributor stats (daily) | 30 days | — | After 30 days |
| API logs | 2 days | — | After 2 days |
| Member attacks | 30 days | — | After 30 days |
| Discord sent dedup | 7 days | — | After 7 days |
| Chain hit queue | 7 days | — | After 7 days |
The daily_energy_usage aggregates table is permanent and is not pruned.
