英文:
Appengine cron.yaml definitions not showing in developer console
问题
我有一个基本的AppEngine项目,包含多个模块和一个dispatch.yaml文件:
- my-project/boxes/app.yaml(默认模块)
- my-project/users/app.yaml(users模块)
- my-project/dispatch.yaml
我试图配置一个每小时运行一次的cron任务,定义如下:
cron:
- description: hourly box purging
url: /api/boxes.purge
schedule: every 1 hours
target: default
我尝试将其添加到相关的模块中,将上述定义放入文件:'my-project/boxes/cron.yaml',然后运行appcfg.py cron_info boxes/
。我的终端似乎显示一切正常:
hourly box purging:
URL: /api/boxes.purge
Schedule: every 1 hours (UTC)
2015-04-30 10:08:00Z, 0:59:55 from now
2015-04-30 11:08:00Z, 1:59:55 from now
2015-04-30 12:08:00Z, 2:59:55 from now
2015-04-30 13:08:00Z, 3:59:55 from now
2015-04-30 14:08:00Z, 4:59:55 from now
然而,AppEngine开发者控制台未能反映出这一点,并且cron任务未能运行。它在本地开发面板上显示出来。
将定义放在项目的根目录(除了dispatch.yaml之外)会产生相同的结果。我尝试过的其他方法(徒劳无功):重新部署所有代码,appcfg.py update_dispatch
,在刷新开发者控制台之前等待一段时间。
希望有人能帮助我找到明显的错误,或者确认是否存在某些错误。
英文:
I have a basic appengine project with multiple modules and a dispatch.yaml:
- my-project/boxes/app.yaml (default module)
- my-project/users/app.yaml (users module)
- my-project/dispatch.yaml
I'm trying to configure a single hourly cronjob with the following definition:
cron:
- description: hourly box purging
url: /api/boxes.purge
schedule: every 1 hours
target: default
I've tried adding it to the module it concerns, so put the above definition in file: 'my-project/boxes/cron.yaml' and running appcfg.py cron_info boxes/
. My terminal seems to indicate all went well:
hourly box purging:
URL: /api/boxes.purge
Schedule: every 1 hours (UTC)
2015-04-30 10:08:00Z, 0:59:55 from now
2015-04-30 11:08:00Z, 1:59:55 from now
2015-04-30 12:08:00Z, 2:59:55 from now
2015-04-30 13:08:00Z, 3:59:55 from now
2015-04-30 14:08:00Z, 4:59:55 from now
Ye the Appengine Developer console fails to reflect this and cron jobs are not run. It does show on the local development panel.
Putting the definition in the root of the projects (besides dispatch.yaml) yields the same results. Other things i've tried (in vain): Redeploying all code, appcfg.py update_dispatch
, waiting a while before refreshing the developer console.
Hopefull someone is able to help me find the obvious mistake, or confirm that their is some bug.
答案1
得分: 0
在文档的配置部分中提到:
可选的应用级配置文件(dispatch.yaml、cron.yaml、index.yaml和queue.yaml)包含在顶级应用目录中。
我同意,段落的上下文似乎留下了解释的余地(通常...)。但引用的文本也表明这些文件被视为应用级配置。所以我会将它们保留在顶层。
关于更新:我注意到,例如,在我的第一次部署中,index.yaml文件没有与其他多模块应用一起上传,我必须显式地使用appcfg.py update_indexes。这在单模块应用中没有发生。也许appcfg.py update_cron也需要显式地使用?
英文:
In the Configuration section of the doc it's stated:
> Optional application-level configuration files (dispatch.yaml,
> cron.yaml, index.yaml, and queue.yaml) are included in the top level
> app directory.
I agree, the paragraph context appears to leave room for interpretation (typically...). But the quoted text also indicates that these files are considered app-level configs. So I'd keep them at the top.
About the update: I noticed, for example, that the index.yaml file was NOT uploaded with the rest of the multi-module app at my first deployment, I had to explicitly use appcfg.py update_indexes. This was not happening with a single module app. Maybe appcfg.py update_cron also needs to be explicit?
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论