3
votes

When setting up a Google App Engine instance you can configure a cron.yaml to set up Cron jobs.

There does not seem to be any documentation on how to configure jobs that run say every 30 seconds.

I tried

schedule: every 30 seconds

and

schedule: 0/30 0 0 ? * * *

But no good. Google Cloud tells me the format is incorrect when I deploy. Can you schedule in frequencies less then 1 minute with Google App Engine Cron jobs?

2

2 Answers

4
votes

You cannot configure GAE cron services with resolutions below 1 minute. FWIW, you can't do that on unix/linux systems either.

But it is possible to use an every 1 minutes cron job from which you can further trigger delayed execution of deferred/push/pull queue tasks with down to 1 second resolution, see High frequency data refresh with Google App Engine

1
votes

Had the same problem, solved with setTimeout(). Using setTimeout for 30 seconds inside the appengine one-minute cron job did the trick, in this case we'll be fetching data 2 times per minute that is every 30 seconds.

saveData(); setTimeout(function () { saveData(); }, 30000);

Tested and worked fine,