Google App Engine queue.yaml在开发服务器中不起作用 [英] Google App Engine queue.yaml not working in development server
问题描述
我无法让dev_appserver.py识别我使用queue.yaml创建的自定义队列.当我尝试添加任务时,它们不会出现在 http://localhost:8000/taskqueue 中给他们我得到UnknownQueueError.在生产环境中效果很好.
I can't get dev_appserver.py to recognize the custom queues I create using queue.yaml. They don't appear in http://localhost:8000/taskqueue, and when I try to add a task to them I get UnknownQueueError. It works fine in the production environment.
我在Windows 10上使用的是python 2.7.
I'm using python 2.7 on Windows 10.
queue.yaml
queue.yaml
total_storage_limit: 5G
queue:
- name: not-queue-a
bucket_size: 500
rate: 10/s
retry_parameters:
task_retry_limit: 2
min_backoff_seconds: 10
target: msnot
- name: ui-worker
target: msbui
bucket_size: 200
rate: 1/s
retry_parameters:
task_retry_limit: 4
min_backoff_seconds: 1
我的项目结构如下:
|-- root
|-- queue.yaml
|-- index.yaml
|-- dispatch.yaml
|-- cron.yaml
|-- microservice1
|-- app.yaml
|-- microservice1.py
|-- microservice2
|-- app.yaml
|-- microservice1.py
|-- microservice3
|-- app.yaml
|-- microservice3.py
|-- microservice4
|-- app.yaml
|-- microservice4.py
我尝试将queue.yaml的副本添加到微服务子文件夹,但是仍然存在相同的问题.我还多次重启了dev_appserver.py.
I tried adding a copy of queue.yaml to the microservice-subfolders, but I still had the same issue. I've also restarted dev_appserver.py several times.
推荐答案
将我的应用程序拆分为多个服务时,我遇到了同样的问题,dev_appserver.py
并没有赶上多服务应用程序.我通过符号链接每个服务中的queue.yaml
文件来解决此问题:
I had the same problem when I split my app into several services, the dev_appserver.py
didn't quite catch up with the multi-services app. I worked around it by symlinking the queue.yaml
file inside each of the services:
|-- microservice1
|-- app.yaml
|-- microservice1.py
|-- queue.yaml -> ../queue.yaml
只有default
服务可能需要 ,但是我不确定,我没有尝试过.
It might only be required for the default
service, but I'm not entirely sure of this, I didn't try it.
Note: I applied a similar approach for other app-level config files. See also Can a default service/module in a Google App Engine app be a sibling of a non-default one in terms of folder structure?
这篇关于Google App Engine queue.yaml在开发服务器中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!