我已經指定了一個cron作業(在開發中測試),但似乎沒有運行。如何確保工作在生產中工作?Cron作業沒有運行(在開發中)
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定義爲:
class CronHandler(webapp.RequestHandler):
def get(self):
logging.info("NOTE: CronHandler get request");
return None
我期待在應用程序引擎的日誌中看到「注:CronHandler獲取請求」這一行。我正在使用GoogleAppEngineLauncher應用(版本:1.5.3.1187)開始&停止應用。
那麼你是如何從Localehost觸發Cron作業的? –