Is there a time limit to Cron jobs in Google Apps?
I have created a cron job to scan rss/atom feeds but want to know if there is a timeout on this.
The documentation says that requests are limited to 30 seconds; is a cron job a regular request that is subject to this restriction?
Should I break the job up into one scan per cron job just to be on the safe side, or is there a better way?
I was thinking of maybe having the cron job spawn tasks into the task queue that would do the resource fetching (so each t开发者_如何学Goask could fetch one resource, and hopefully none would overrun the 30 second limit).
Any advice would be appreciated.
Cron jobs are subject to a 10 minute deadline, not 30 seconds.
See App Engine version 1.4 release page:
No more 30-second limit for background work - With this release, we’ve significantly raised this limit for offline requests from Task Queue and Cron: you can now run for up to 10 minutes without interruption.
@Alex Martelli's answer was correct at the time he wrote it, but is now out of date.
Yes, the 30-seconds deadline applies to cron jobs, too (just as to regular requests and task queue jobs). The best way to "break things up" is generally to enqueue "continuation" requests on a task queue.
Cron jobs on manually scaled instances can run for up to 24 hours (they're subject to the same limits as task queues). Auto-scaled instances must still finish within 10 minutes.
精彩评论