Cron scheduler synchronized is not working as expected.

78 views
Skip to first unread message

Creative Cubs

unread,
Aug 7, 2015, 11:06:37 PM8/7/15
to Google App Engine

I want to run a cron for every 2 minutes interval, 0,2,4,6,8 .... each cron execution runs for 2 minutes. 


I configured cron schedule with synchronized as below. But I still see scheduler is behaving as if synchronized not given. 

Crons are scheduled at 

0-2 First cron

4-6 Second cron

8-10 third cron


Cron scheduler is waiting for 2 minutes after last cron execution. 

If I understand synchronized correctly, it is added to avoid this behavior. 


Please help why this happening. 


  <cron>

    <url>/cron/syncPrices</url>

    <description>Fetch data from source and cache it in data store.</description>

    <schedule>every 2 minutes synchronized</schedule>

  </cron>


Ryan (Cloud Platform Support)

unread,
Aug 10, 2015, 3:22:09 PM8/10/15
to Google App Engine
If the cron job runs longer than the interval it will reset the clock. If you really need the every 2 minutes and your code is running longer than 2 minutes try running 2 crons at 4 minutes staggered 2 minutes apart.
Reply all
Reply to author
Forward
0 new messages