ViaTech
ViaTech

Reputation: 2813

2019: Dynamic cron jobs Google App Engine

I am developing a reporting service (i.e. Database reports via email) for a project on Google App Engine, naturally using the Google Cloud Platform.

I am using Python and Django but I feel that may be unimportant to my question specifically. I want to be able to allow users of my application schedule specific cron reports to send off at specified times of the day.

I know this is completely possible by running a cron on GAE on a minute-by-minute basis (using cron.yaml since I'm using Python) and providing the logic to determine which reports to run in whatever view I decide to make the cron hit, but this seems terribly inefficient to me, and seeing as the best answer I have found suggests doing the same thing (Adding dynamic cron jobs to GAE), I wanted an "updated" suggestion.

Is there at this point in time a better option than running a cron every minute and checking a DB full of client entries to determine which report to fire off?

Upvotes: 3

Views: 1912

Answers (2)

LundinCast
LundinCast

Reputation: 9810

You may want to have a look at the new Google Cloud Scheduler service (in beta at the moment), which is a fully managed cron job service. It allows you to create cron jobs programmatically via its REST API. So you could create a specific cron job per customer with the appropriate schedule to fit you needs.

Upvotes: 3

Alex
Alex

Reputation: 5276

Given this limit, my guess would be NO

Free applications can have up to 20 scheduled tasks. Paid applications can have up to 250 scheduled tasks.

https://cloud.google.com/appengine/docs/standard/python/config/cronref#limits

Another version of your minute-by-minute workaround would be a daily cron task that finds everyone that wants to be launched that day, and then use the _eta argument to pinpoint the precise moment in each day for each task to launch.

Upvotes: 2

Related Questions