My remainder should run every 2 hours - sechulder

50 views
Skip to first unread message

Taxideals ch

unread,
Sep 17, 2018, 3:12:51 PM9/17/18
to Google App Engine
Hi,

scheduler application for  24 hours, every 2 hours, want trigger into below code. 

1)my cron job will give task to below task queue

Questions : How to bring it from 24 hours to 2 hours
 every 2 hours, application should run)

Sample code
TaskOptions task = TaskOptions.Builder.withUrl("/booking/reminder/worker")
.taskName(bookingId)
//so we can delete it by bookingId if we need to
.payload(bookingId)
.countdownMillis(delayInSeconds * 1000); //the time before it appears on the worker.


//throw it on the queue
Queue queue = QueueFactory.getQueue("bookingReminderQueue");
queue.add(task);

George (Cloud Platform Support)

unread,
Sep 17, 2018, 8:52:49 PM9/17/18
to Google App Engine
Do you want to run your code each two hours instead of 24 hours? Do you want to have Cron Service run for a total of 24 hours? 

Schedule is to be specified in your case as: "<schedule>every 2 hours</schedule>" in your cron.yaml file, to have your job run every 2 hours. The App Engine Cron Service allows you to configure regularly scheduled tasks that operate at defined times or regular intervals. It is not possible to limit the duration Cron Service runs for you to only 24 hours: the main use of the service implies re-occurrence and repeated tasks. You may gather more detail from the "Scheduling Tasks With Cron for Java" (if you use Java) documentation page. More on cron.yaml syntax on the "Scheduling Jobs with cron.yaml" page

You are most welcome asking more detailed questions, if the above does not address your issue in its entirety. 
Reply all
Reply to author
Forward
0 new messages