I specified the cron job (for testing in development), but it does not seem to work. How to make sure that jobs will work in production?
cron.yaml:
cron:
- description: cron test gathering
url: /test/cron
schedule: every 2 minutes from 09:00 to 23:00
app.yaml:
application: cron_test
version: 1
runtime: python
api_version: 1
handlers:
- url: /.*
script: main.py
main.py:
url_map = [ ('/test/cron', test.CronHandler),
('/error', err.Err404Handler)]
application = webapp.WSGIApplication(url_map, debug=False)
def main():
wsgiref.handlers.CGIHandler().run(application)
if __name__ == "__main__":
main()
FeedCron is defined as:
class CronHandler(webapp.RequestHandler):
def get(self):
logging.info("NOTE: CronHandler get request");
return None
I expected to see the line, βNOTE: CronHandler request to receive,β in the application engine logs. I am using the GoogleAppEngineLauncher application (version: 1.5.3.1187) to start and stop the application.
source
share