简体   繁体   English

即使未定义cron.yaml文件,Google Appengine也会运行Cron任务

[英]Google Appengine runs Cron tasks even if they are no cron.yaml file defined

I start receiving errors from the CRON service even if I have not a single cron.yaml file defined. 即使没有定义单个cron.yaml文件,我也开始从CRON服务接收错误。

The cron task runs every 4 hours. cron任务每4小时运行一次。

I really don't know where to look at in order to correct such behaviour. 我真的不知道在哪里可以纠正这种行为。 Please tell me what kind of information is needed to correct the error. 请告诉我需要哪种信息来纠正错误。

Cron jobs Cron职位

First Cron error 第一次Cron错误

Cron Job : /admin/push/feedbackservice/process - Query APNS Feedback service and remove inactive devices Cron作业 :/ admin / push / feedbackservice / process-查询APNS反馈服务并删除不活动的设备

Schedule/Last Run/Last Status (All times are UTC) : every 4 hours (UTC) 2014/06/10 07:00:23 on time Failed 计划/上次运行/最后一次状态(所有时间均为UTC):每4小时(UTC)2014/06/10 07:00:23准时失败

Second Cron error 第二Cron错误

Cron job: /admin/push/notifications/cleanup - Remove no longer needed records of processed notifications Cron作业: / admin / push / notifications / cleanup-删除不再需要的已处理通知记录

Schedule/Last Run/Last Status (All times are UTC) : every day 04:45 (America/New_York) - 2014/06/09 04:45:01 on time Failed 计划/最近运行/最后一次状态(所有时间均为UTC):每天04:45(美国/纽约)-2014/06/09 04:45:01准时失败

Console log 控制台日志

2014-06-10 09:00:24.064 /admin/push/feedbackservice/process 404 626ms 0kb AppEngine-Google; (+http://code.google.com/appengine) module=default version=1 0.1.0.1 - - [10/Jun/2014:00:00:24 -0700] "GET /admin/push/feedbackservice/process HTTP/1.1" 404 113 - "AppEngine-Google; (+http://code.google.com/appengine)" "xxx-dev.appspot.com" ms=627 cpu_ms=353 cpm_usd=0.000013 queue_name=__cron task_name=471b6c0016980883f8225c35b96 loading_request=1 app_engine_release=1.9.5 instance=00c61b17c3c8be02ef95578ba43 I 2014-06-10 09:00:24.063

This request caused a new process to be started for your application, and thus caused your application code to be loaded for the first time. This request may thus take longer and use more CPU than a typical request for your application.

The tip from @Greg above solved that problem for me. 上面@Greg的提示为我解决了这个问题。

Note the full sequence of events: 注意事件的完整顺序:

  1. A past version of the application included a cron.yaml file that ran every hour 该应用程序的先前版本包含一个每小时运行一次的cron.yaml文件

  2. In a successive version, I removed the cron.yaml file, thinking that was enough, but then I discovered that the cron jobs were still running! 在后续版本中,我删除了cron.yaml文件,以为足够了,但是后来我发现cron作业仍在运行!

  3. Uploading an EMPTY cron.yaml file didn't change things either 上载EMPTY cron.yaml文件也没有改变

  4. Uploading a cron.yaml file with only "cron:" in it did it -- the cron jobs just stopped. 上载仅包含“ cron:”的cron.yaml文件即可完成-cron作业刚刚停止。

From the above I reckon that the way things work is this: when a cron.yaml file is found it is parsed, and if the syntax is correct, its cron jobs are loaded in the app server. 从上面的内容,我认为工作方式是这样的:找到cron.yaml文件时,将对其进行解析,并且如果语法正确,则将其cron作业加载到应用服务器中。 And apparently, just removing the cron.yaml file from a successive version, or loading an empty one (ie un-parseable, bad syntax) doesn't remove the cron jobs. 显然,仅从后续版本中删除cron.yaml文件,或加载一个空文件(即,不可解析的,错误的语法)都不会删除cron作业。 The only way to remove the cron jobs is to load a new, PARSEABLE cron.yaml file, ie with the "cron:" line, but with no actual jobs after that. 删除cron作业的唯一方法是加载一个新的PARSEABLE cron.yaml文件,即使用“ cron:”行,但此后没有实际的作业。

And the proof of the pudding is that after you do that, you can now remove cron.yaml from successive versions, and those old cron jobs will not come back any more. 布丁的证明是,这样做之后,您现在可以从后续版本中删除cron.yaml,这些旧的cron作业将不再恢复。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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