Bri*_*ach 6 google-app-engine app-engine-flexible
我正在尝试在 Google Cloud Platform 中设置 CRON 作业。该作业显示在 GCP 控制台中,但它失败了。没有日志可以说明它失败的原因。计划似乎工作正常,我能够手动运行该作业,尽管手动启动时它也会失败。
如果我转到http://...../api/status/additurl 栏中,该作业将按预期运行。
任务队列页面上有一个“查看日志”的链接,它显示了我的 CRON 作业,但是当我转到这些日志时,它们完全是空的。
查看 nginx 请求日志不会显示对该 url 发出的任何请求(或任何与此相关的请求)。如果我手动转到作业的 url,我可以看到这些请求显示在日志中,并且应该发生的一切都发生了,所以我知道端点是好的。
Google App Engine 柔性环境,Python 3
烧瓶API
我还能提供哪些其他信息?有很多活动部分,我不想用不相关的信息淹没这个问题。
cron.yaml:
cron:
- description: 'test cron job'
url: /api/status/addit
schedule: every 1 minutes
Run Code Online (Sandbox Code Playgroud)
端点:
< some Flask Blueprint stuff initiates the "status" blueprint so that this url will resolve to /api/status/addit >
...
@status.route('/addit')
def add_to_file():
print('made it into the request')
from flask import Response
res = Response("{'foo':'bar'}", status=202, mimetype='application/json')
return res
Run Code Online (Sandbox Code Playgroud)
您的网址不匹配。尝试:
cron:
- description: 'test cron job'
url: /addit
schedule: every 1 minutes
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1556 次 |
| 最近记录: |