【发布时间】:2018-07-07 14:55:47
【问题描述】:
我什至无法获得一个任务队列来触发一个简单的打印语句。
我不知道我的应用结构是否不正确...
最简单的任务队列示例及其结构是什么?
因为这对我不起作用:
@app.route('/task', methods=["GET", "POST"])
def testtask():
print "Hi, I'm calling the task"
taskqueue.add(
url='/execute_task'
)
return "I called the task"
@app.route('/execute_task', methods=["GET", "POST"])
def execute_task():
print "I'm executing the task"
return "I excecuted the task"
两条路由都在 app.yaml 文件中:
- url: /execute_task
script: app.app
login: admin
- url: /task
script: app.app
login: admin
在终端:
嗨,我正在调用任务 INFO 2018-01-28 23:00:49,521 module.py:788] 默认值:"GET /task HTTP/1.1" 200 17
http://localhost:8000/taskqueue
显示:
队列名称最大速率桶大小队列中最旧的任务 (UTC) 任务
默认 5.00/s 5 2018/01/28 22:59:59(0:04:44 前) 2
【问题讨论】:
标签: python google-app-engine task-queue