小编use*_*561的帖子

App Engine Python开发服务器+ Taskqueue +后端

我正在使用GAE Python 2.7和本地开发服务器.我配置了一个后端

backends:
- name: worker
  class: B1
  options: dynamic
Run Code Online (Sandbox Code Playgroud)

我正在使用默认的taskqueue.一切正常,后端和任务队列在SDK控制台上可见.本地开发工作也开始没有任何错误:

Multiprocess Setup Complete:
Remote API Server [http://localhost:9200]
App Instance [http://localhost:9000]
Backend Instance: worker.0 [http://localhost:9100]
Backend Balancer: worker [http://localhost:9199]
Run Code Online (Sandbox Code Playgroud)

但是如果我尝试通过任务解决后端问题

taskqueue.add(url='/xyz', method='POST', target='worker', params={'a':'b'})
Run Code Online (Sandbox Code Playgroud)

这个错误提出:

ERROR An error occured while sending the task "task1" (Url: "/backend/languages/create_database/") in queue "default". Treating as a task error.
Traceback (most recent call last):
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/api/taskqueue/taskqueue_stub.py", line 1884, in ExecuteTask
    connection.endheaders()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 937, in endheaders
    self._send_output(message_body)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 797, in _send_output …
Run Code Online (Sandbox Code Playgroud)

python google-app-engine

7
推荐指数
1
解决办法
1655
查看次数

标签 统计

google-app-engine ×1

python ×1