Python Google App Engine Cron Job Not Working

2019-09-16 12:51发布

I am creating cron job and it's work on the local dev sever (http://localhost:8000/cron).

I uploaded application to google app engine, but I see "You have not created any scheduled tasks (cron jobs) for this application."

My cron.yaml:

cron:
- description: calc week raiting
  url: /cron_everyhour
  schedule: every 1 hours

My app.yaml:

application: w....
version: 1
runtime: python27
api_version: 1
threadsafe: true

libraries:
- name: django
  version: "1.2"

handlers:
- url: /css
  static_dir: css
- url: /images
  static_dir: images
- url: /img
  static_dir: img
- url: /js
  static_dir: js
- url: /sound
  static_dir: sound
- url: /swf
  static_dir: swf
- url: /favicon\.ico
  static_files: images/favicon.ico
  upload: images/favicon\.ico
- url: /apple-touch-icon-precomposed.png
  static_files: js/apple-touch-icon-precomposed.png
  upload: js/apple-touch-icon-precomposed.png
- url: /apple-touch-icon.png
  static_files: js/apple-touch-icon.png
  upload: js/apple-touch-icon.png
- url: .*
  script: main.APP

1条回答
混吃等死
2楼-- · 2019-09-16 13:16

In some cases uploading the app alone doesn't update the cron jobs, in such case you need to update the cron jobs specifically using appcfg.py update_cron, see https://cloud.google.com/appengine/docs/python/config/cron#Python_app_yaml_Uploading_cron_jobs

查看更多
登录 后发表回答