CRON on Deploy
Hey, is CRON working fine on Deploy? Maybe I don't know how to use it. I have created a file cron.ts a put there:
Deno.cron('Run once a minute', '* * * * *', () => {
console.log('Hello, cron!');
});
It deployed on prod but there is nothing in CRON tab.
7 Replies
Hi, I have teh same problem, did you found a solution?
You have to import it from the entrypoint
I did so in my main.ts
but this doesn't show up as running, in logs on deploy it says
Crons are not supported for preview deployments. Cron jobs will not be executed in this context.Which I don't understand as it isn't a preview deployment?
Did u deployed with —prod flag or promoted a preview deployment to prod?
Promoted one to prod 👀
I think that did it, it now shows up in the cron tab
Yes, if you deploy with —prod flag you get the cron
I think is related with the early version access
Have you got this option enabled in the us?
UI*
I think is because the way it works, its on deploy deno deploy scan for usages of deno cron, but that doesn’t seems to happend when promoting deployments