Scheduling Tasks with User params

42 views
Skip to first unread message

Marco Galassi

unread,
Mar 10, 2017, 4:11:36 AM3/10/17
to Google App Engine
I would like to find a way to run repeated jobs (such as cron jobs) with some parameters.

For example, if I would like to have an email service that every day sends out emails to every user
of the application. This could be done via cron, but I would like to add a layer of "personalization"
giving the admin the ability to change the time that this happens, for eg. at 12:00am rather than 15:00pm.

Looks like the Cron Jobs service does not provide any way to perform this, and neither the Task Queue, where,
as far as I have understood, does not provide a way to schedule tasks or jobs, but only a way to give the app
a task to do and then let the app perform it.

Is there any solution, no matter what language or environment?

Cheers,
Marco

Jordan (Cloud Platform Support)

unread,
Mar 10, 2017, 2:52:18 PM3/10/17
to Google App Engine
You can update the schedule of any CRON job by changing your cron.yaml and redeploying it. You are able to use any of the following Schedule Formats (e.g every day 15:00) to tell your CRON when to run. 

Alex Martelli

unread,
Mar 10, 2017, 3:29:30 PM3/10/17
to google-a...@googlegroups.com
On Fri, Mar 10, 2017 at 11:52 AM, 'Jordan (Cloud Platform Support)' via Google App Engine <google-a...@googlegroups.com> wrote:
You can update the schedule of any CRON job by changing your cron.yaml and redeploying it. You are able to use any of the following Schedule Formats (e.g every day 15:00) to tell your CRON when to run. 

Jordan is right. Also note that, to get similar effects without needing the ability to redeploy cron.yaml, in many cases a simple trick can be used: have the cron.yaml trigger (e.g) every hour, and hold a singleton entity in the datastore recording on which of these 24 daily occurrences the code must actually do any work (as opposed to just return immediately).

That singleton entity in the datastore can be set, checked, and overwritten, with any web UI and/or remote API of your choice, of course.


Alex

--
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-appengine+unsubscribe@googlegroups.com.
To post to this group, send email to google-appengine@googlegroups.com.
Visit this group at https://groups.google.com/group/google-appengine.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-appengine/b386d3e9-802f-430d-a729-8c8a528af5db%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages