Cron does not support granularity of less than one minute. As for how long would the cron in GAE would run, the docs said:
An HTTP request invoked by cron can run for up to 10 minutes, but is subject to the same limits as other HTTP requests.
This suggest to me that cron requests is treated the same with task queue requests. Requests to a frontend instance has 10 minute to finish executing, while requests to backend have a 24-hour deadline.
Edit:
If you really need 30 second granularity on your cron, a bit of a workaround is possible by exploiting the countdown
property of the Task in TaskQueue. The steps are as follows:
- Have a one-minute cron that executes a different servlet than your intended /test servlet.
- Have this servlet create two tasks that point to the intended /test servlet. Each of the task has 30 and 60 values for its
countdown
property.
- Push both tasks to the TaskQueue.
Alternatively, you could precompute the intended ETA at 30 seconds and 60 seconds from the start of the servlet, and put it in the eta
property instead for a better granularity.
A final caveat, the eta
and countdown
does not guarantee that the task would be executed at exactly the prescribed time. If your queue is saturated, or your instances are overloaded, some delay could be expected.