Simplify your stack and build anything. Or everything.
Build tomorrow’s web with a modern solution you truly own.
Code-based nature means you can build on top of it to power anything.
It’s time to take back your content infrastructure.

Why is my cloud project deploying twice?

default discord avatar
sassycoderlast year
3

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.



The repo is private but lmk your github account and I will give you access.

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.

  • discord user avatar
    denolfe
    last year

    Hey @sassycoder , this is happening because you're on the Pro tier which deploys

    2 instances

    for 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.

  • default discord avatar
    sassycoderlast year

    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!

  • discord user avatar
    denolfe
    last year

    No problem, that sounds like a good solution 👍

Star on GitHub

Star

Chat on Discord

Discord

online

Can't find what you're looking for?

Get help straight from the Payload team with an Enterprise License.