sae Python下设置定时任务

来源:互联网 发布:淘宝天猫评论采集工具 编辑:程序博客网 时间:2024/06/05 22:46

官方文档在这里:http://sae.sina.com.cn/doc/python/cron.html


就是通过在config.yaml文件中添加Cron段,例如:

cron:
- description: timing_task
  url: /on_time
  schedule: "*/5 * * * *"

代表每5分钟以get方式访问/on_time这个链接。


还可以结合sae中的Taskqueue服务把大任务分成小任务,因为sae对于每次访问有时间限制,不能超过300秒。



提醒冒号后面记得留一个空格!

0 0
原创粉丝点击