如何在谷歌应用引擎中传递关于cron的参数


How to pass arguments on cron in Google App Engine?

我正试图在谷歌应用引擎中运行带有参数的cron作业,但无法在cron.yaml中发送任何参数。有人知道如何在cron.yaml中发送参数吗?

handlers:
- url: /testing
  script: testing.php

我想发送的是testing.php?testing=12345,但如果我这样写,脚本就不会运行。

我读到这个:

如何在谷歌应用引擎上向python cron任务传递参数?

但我并没有像Python那样理解太多。

谢谢!

cron: - description: Testing Cron url: /testing.php?testing=12345 schedule: every 60 mins

根据谷歌(https://developers.google.com/appengine/docs/php/config/cron)以上应该是正确的语法,请注意使用cron而不是处理程序。

我想知道为什么要使用查询字符串参数?如果这是为了限制访问,你可以通过只添加管理员登录来轻松做到这一点:

cron: - description: Testing Cron url: /testing.php?testing=12345 schedule: every 60 mins login: admin

或者,如果你确信在url的末尾添加查询字符串不起作用,你可以总是为不同的任务使用不同的url。。。