douyinmian8151 2014-09-02 16:12
浏览 31

如何在Google App Engine中传递关于cron的参数?

I am trying to run a cron job in Google App Engine with a parameter but cannot send any parameters in cron.yaml. Anyone know how to send parameters in cron.yaml?

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

What I want to send is testing.php?testing=12345, but the script won't run if I write it like that.

I read this:

How to pass arguments to a python cron task on Google App Engine?

.. but I didnt understand much of it as it was for Python.

Thanks!

  • 写回答

1条回答 默认 最新

  • douchen7324 2014-09-02 16:44
    关注

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

    According to Google ( https://developers.google.com/appengine/docs/php/config/cron ) the above should be the correct syntax, note the use of cron instead of handlers.

    I'd like to know why you are using a query string parameter? If this is to restrict access you could easily do this by adding admin login only:

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

    Alternatively if you are convinced that adding a query string to the end of your url is not working you can always use different urls for differing tasks...

    评论

报告相同问题?

悬赏问题

  • ¥15 python的qt5界面
  • ¥15 无线电能传输系统MATLAB仿真问题
  • ¥50 如何用脚本实现输入法的热键设置
  • ¥20 我想使用一些网络协议或者部分协议也行,主要想实现类似于traceroute的一定步长内的路由拓扑功能
  • ¥30 深度学习,前后端连接
  • ¥15 孟德尔随机化结果不一致
  • ¥15 apm2.8飞控罗盘bad health,加速度计校准失败
  • ¥15 求解O-S方程的特征值问题给出边界层布拉休斯平行流的中性曲线
  • ¥15 谁有desed数据集呀
  • ¥20 手写数字识别运行c仿真时,程序报错错误代码sim211-100