我试图找出uWSGI的spooler mechanism,因此我用Django(版本1.3.1)编写了一个小型的、虚拟的web应用程序,它运行在nginx的最新稳定版本上。一切如期进行。但是,在我的一个视图中,我正在向uWSGI容器发送一个spool消息,我得到以下错误:
[spooler /private/tmp/receiver pid: 4115] managing request uwsgi_spoolfile_on_ozgurv.local_4165_1_0_1338280641_366596 ...
unable to find the spooler function, have you loaded it into the spooler process ?
在我的测试中/视图.py文件:
^{pr2}$在我的测试中/线轴.py文件:
from uwsgidecorators import *
@spool
def three_seconds(*args, **kwargs):
f = open('/tmp/args.data', 'a')
f.write(repr(kwargs) + '\n')
f.close()
当我通过在浏览器中请求url/call/来执行“call”函数时,出现了以下错误:
[spooler /private/tmp/receiver pid: 4115] managing request uwsgi_spoolfile_on_ozgurv.local_4165_1_0_1338280641_366596 ...
unable to find the spooler function, have you loaded it into the spooler process ?
uWSGI正在使用以下参数运行:
sudo uwsgi --ini ~/uwsgi.ini -b 20000
以及我的内容uwsgi.ini文件文件如下所示:
[uwsgi]
socket = 127.0.0.1:8081
listen = 4096
master = true
processes = 4
pidfile = /var/run/uwsgi.pid
enable-threads = true
uid=root
gid=admin
single-interpreter = true
disable-logging = true
buffer-size= 32768
reload-on-as = 10240
reload-on-rss = 512i0
max-requests = 50000
pythonpath = /Users/ozgurv/Developer/warehouse
module = wsgi_handler
plugins = python27,spooler
spooler-processes = 1
spooler = /tmp/receiver
我不知道为什么它一直在抱怨假脱机程序函数,以及为什么uwsgi找不到它。“你把它装进假脱机程序”是什么意思?如何在后台处理程序的上下文中加载后台处理程序函数?在
使用后台处理程序import=testapp/线轴.py在
后台处理程序将在其进程地址空间中导入该模块
另一个解决方案是在所有uwsgi进程中导入模块
导入=测试应用程序/线轴.py在
相关问题 更多 >
编程相关推荐