Multi Container Deployment and Cron Jobs


#1

I am using the npm cron module to create some datasets nightly on one of my apps. Based on a schedule they create a number of reports in my database.

For a short while now I’ve used 2 galaxy containers to run this application and this has resulted in these being triggered twice, resulting in duplicates.

The obvious fix is to set a unique index on the collection they are writing two, which I have done.

I wonder if there is a way to trigger a scheduled process on only one of multiple containers or to spread the load of a batch of jobs between containers.


#2

Use the job-collection package: https://github.com/vsivsi/meteor-job-collection


#3

Another option is the synced-cron package: https://github.com/percolatestudio/meteor-synced-cron/