Node-cron job not executing in paid plan

I have a paid node web service at https://warm-mailer.onrender.com in which I am running a cron job to execute a script at a specified time everyday, but the script is not getting executed. Please let me know what am I doing wrong. Note that my web service is in ‘Starter’ plan.

Thanks

This feels like it’s probably related to your other topic at Error: connect ECONNREFUSED 127.0.0.1:6379. You may find that once that’s resolved, this will work.

Hi, now that I have fixed the ECONNREFUSED issue, the cron job I scheduled in my node server is not getting executed. Is there any timezone parameters I should take into consideration?

Hey,

Could you provide more details on how you’re scheduled cron jobs? What settings you’ve used, etc.

Jérémy.
Render Support, UTC+3

I set the cron schedule like this below, everyday at 13:40 hrs (01:40PM)

cron.schedule(“40 13 * * *”, async () => {
console.log(“Cron Started!”, new Date());
await jobScheduled()
});

the server log says ‘Cron Started! 2024-08-15T13:41:00.577Z’ but it really got executed after 8 hours. so the job got executed 13:40 GMT not Singapore Standard Time. Is this usual behaviour?

Hey,

Is there a reason you’re setting up this cron job within your web service instead of using a dedicated cron-type service? I’d recommend separating cron jobs from your main web service to avoid resource conflicts within a single instance.

Jérémy.
Render Support, UTC+3

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.