简体   繁体   中英

Google App Engine Cron Job

I have created a cron.xml file and a servlet which describes the job.
Now when i compile and login as an admin, local development dashboard doesn't show Cron Jobs link.

Local development server does not have the Cron Jobs link neither does it execute cron jobs. The actual appengine will show cron jobs and will execute them.

You can manually execute cron jobs on local server by visiting their urls. eg http://localhost:8888/FindReservedBooksTask .

BTW the cron.xml file should be in the war/WEB-INF directory.

The dev appserver doesn't automatically run your cron jobs. You can use your local desktop's cron or scheduled tasks interface to hit the URLs of your jobs with curl or a similar tool.

Here is the link to the GAE doc on this.

Also, make sure you disable all security constraints for your crons in the web.xml. If you don't have them -- you should restrict cron to admin accounts .

This website walks you through the way to use cron jobs inside of Google App Engine.

Also, The Google App Engine provides a service called the Cron Service that helps us do two fundamental things:

  1. Allows your application to schedule these tasks.
  2. Execute these tasks based on their schedule.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM