scheduling job using cron.xml in google app engine

210 views
Skip to first unread message

abhishek grover

unread,
Jun 24, 2018, 4:05:39 AM6/24/18
to Google App Engine
Hi All,

Can anyone help me on how to schedule job using cron.xml.
My requirement is to schedule job every 2 min  from 09:00 to 10:00 in weekdays.
As per the google docs i have come up with below schedule format.
But this format will schedule job for weekend also.
So can anyone tell me how to add the weekday option in below format.

   <schedule>every 2 minutes from 09:00 to 10:00</schedule>

Giuliano Ribeiro

unread,
Jun 24, 2018, 2:26:18 PM6/24/18
to Google App Engine
Hi, have you read more about this here:

I haven't found a example like you want and I guess it is not possible.

Take a look on the documentation page.

Vitaly Bogomolov

unread,
Jun 24, 2018, 3:43:31 PM6/24/18
to Google App Engine
Hi.

You can't implement this task directly, according cron rules. But you can use some tricks with AppEngine abilities. For example.

Add cron rule, that will be called at  09:00 in weekdays
In the handler of this rule put 30 tasks to appengine taskqueue with appropriate delay. You can use one of the 'countdown' or 'eta' parameters .(https://cloud.google.com/appengine/docs/standard/python/refdocs/google.appengine.api.taskqueue.taskqueue#google.appengine.api.taskqueue.taskqueue.add). 

You code may be something like this:

for i in range(30):
  taskqueue.add(
    url='/you_working_function_url',
    countdown=i*120  # delay in seconds
  ) 

WBR, Vitaly.
 

Taxideals ch

unread,
Sep 17, 2018, 3:42:43 PM9/17/18
to Google App Engine
Thanks for your answers

Every day i check booking s(100 bookings) from cron jon, it gives 200 bookings

* have to run task queue 1 hour before, different booking in different time.

* How many ques have to create, thx 

Sam (Google Cloud Support)

unread,
Sep 18, 2018, 5:05:41 PM9/18/18
to Google App Engine
Hi,

I am not sure I understand your question. Maybe you can clarify what you mean by "it gives 200 bookings."

This documentation address how to create and test cron jobs: https://cloud.google.com/appengine/docs/standard/python/config/cron#creating_a_cron_job
Reply all
Reply to author
Forward
0 new messages