There is no pattern because it depends on whether your process happened to be awake at 02:00. node-cron is a timer inside a running process. On a deployment that sleeps when idle, and your app is idle at two in the morning, the timer simply does not exist at that moment.
Move the job out of the web process. Two options that both work on Replit:
- A Scheduled Deployment, which is a separate run on a cron expression. Point it at a
scripts/rollup.jsthat does the work and exits. - Supabase
pg_cronif the rollup is pure SQL, which from your code it almost is.
Either way, make the job idempotent: insert ... on conflict (day) do update. Then a double run on a retry is harmless.