We are currently implementing a sync system with CRON inside our CMS, everything works fine, except once deployed, since we have 2 instances in the cloud, both runs at the same time, and we don't want that.
Is there some ENV variable or something I can do to force only one instance to run CRON tasks?
Know which instance is running on PayloadCloud - Urgent
Hmm, this is a tricky one. One option is we could expose configuring instance count for projects. I can look into other possibilities as well, but no other ideas on how to solve it come to mind as of now.
As of now, we set instance count to 1 for standard plans and 2 for tiers beyond that. Sounds like you're on a Pro plan, correct?
Correct we do!
We like the fact of having two instances to reduce the load though
I think we'll simply deploy a route to launch cron tasks externally, whichever one will receive it will take it in charge
Yeah, that sounds like a good solution. This is a tricky problem to solve. Let me know if I can help with anything else 👍
Running cron in Payload Cloud
Star
Discord
online
Get dedicated engineering support directly from the Payload team..