Cronjob in an App with 2 machines

If I have an app with 2 machines.

And inside the app we run a cronjob every morning, would it be run twice?

Hi,

From that alone, I’d assume yes. As each machine would be independent of the other, running its own copy of the code.

You could easily confirm by logging a message, then checking e.g fly logs. See if it’s there twice.

Fly doesn’t have a managed cron service that I know of :thinking: There are a variety of threads about crons. They do have scheduled machines which you could maybe use instead …

Or Supercronic:

I don’t know what the recommended approach is right now :thinking:. Else you are stuck using something like this from Google :slightly_frowning_face: Cloud Scheduler  |  Google Cloud

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