After building, Payloud Cloud deploys my project twice. This causes my CRON job scripts to run twice. I removed the CRON jobs from the code to show it isn't them causing the double deploy.
Screenshot attached is of the Deploy Logs with the CRON job removed.
Is there something with my build settings causing this? I do not experience this issue locally.
Project ID is
64c7eda1c2cb3c107036482c
I am on Payload version
1.15.6
I've attached my
server.ts
and
payload.config.ts
code.
Please let me know if you need any other information. I'm at a total loss.
Hey @sassycoder , this is happening because you're on the Pro tier which deploys
2 instancesfor better redundancy and load balancing. Unfortunately, this means that anything that is not inbound ie. cron, will actually run for both instances.
Currently, we don't have a way to customize the number of instances for a project, but this is something we're exploring right now.
Hope that answers your question, let me know if you have any others.
Hi Elliot! I’m just glad it isn’t me haha. I’ve got an idea for just making it an endpoint and running the CRON job from the front end instead. Thanks for the reply!
No problem, that sounds like a good solution 👍
Star
Discord
online
Get help straight from the Payload team with an Enterprise License.