The short answer
A scheduler in your own code, such as node-cron, setInterval, schedule or APScheduler, only works while the app is running. Antideploy scales an idle app to zero, so the timer stops with it and never fires. Move the work into a route, and ask your agent to schedule a call to that route. Antideploy calls it on your schedule and wakes the app.
How to tell
-
Your code has
node-cron,cron,node-schedule,setIntervalor similar. Antideploy flags a scheduler inside the process before you deploy, and says the timer will not fire. -
A nightly job never ran. The app was asleep at that time.
How to fix it
-
Move the work into a route
For example,
POST /api/cron/nightlydoes what your timer did. -
Ask your agent to schedule it
Say: "Run /api/cron/nightly every day at 3am UTC." Antideploy sends a request to that path on your schedule and wakes the app if it is asleep.
-
Protect the route
Anyone can send the cron header, so a route that does real work should check a secret of your own.
See how to run a scheduled job for the code and the rules.