我正在尝试使用Django芹菜使用RabbitMQ配置一个计划任务。在我的项目目录中为芹菜类和一些任务创建对象后,当我试图使用以下命令
配置Worker时"芹菜-A myproj worker"我得到以下跟踪
Traceback (most recent call last):
File "c:usersmurugk7envscelery_testlibsite-packagesceleryworkerworker.py", line 203, in sta
rt
self.blueprint.start(self)
File "c:usersmurugk7envscelery_testlibsite-packagescelerybootsteps.py", line 119, in start
step.start(parent)
File "c:usersmurugk7envscelery_testlibsite-packagescelerybootsteps.py", line 370, in start
return self.obj.start()
File "c:usersmurugk7envscelery_testlibsite-packagesceleryconcurrencybase.py", line 131, in
start
self.on_start()
File "c:usersmurugk7envscelery_testlibsite-packagesceleryconcurrencyprefork.py", line 112,
in on_start
**self.options)
File "c:usersmurugk7envscelery_testlibsite-packagesbilliardpool.py", line 1008, in __init__
self._create_worker_process(i)
File "c:usersmurugk7envscelery_testlibsite-packagesbilliardpool.py", line 1117, in _create_w
orker_process
w.start()
File "c:usersmurugk7envscelery_testlibsite-packagesbilliardprocess.py", line 122, in start
self._popen = self._Popen(self)
File "c:usersmurugk7envscelery_testlibsite-packagesbilliardcontext.py", line 383, in _Popen
return Popen(process_obj)
File "c:usersmurugk7envscelery_testlibsite-packagesbilliardpopen_spawn_win32.py", line 64, i
n __init__
_winapi.CloseHandle(ht)
TypeError: must be integer<k>, not _subprocess_handle
(celery_test) C:kavinAssignerassigner>Traceback (most recent call last):
File "<string>", line 1, in <module>
File "c:usersmurugk7envscelery_testlibsite-packagesbilliardspawn.py", line 159, in spawn_mai
n
new_handle = steal_handle(parent_pid, pipe_handle)
File "c:usersmurugk7envscelery_testlibsite-packagesbilliardreduction.py", line 121, in steal
_handle
_winapi.PROCESS_DUP_HANDLE, False, source_pid)
WindowsError: [Error 87] The parameter is incorrect
在settings.py中有
app = Celery('assigner',
broker='amqp://myuser:mypass@localhost/my_Vhost',
backend='rpc://',
include=['assigner.tasks'])
在tasks.py中,有
from __future__ import absolute_import
from assigner.celery import app
import time
@app.task
def longtime_add(x, y):
print 'long time task begins'
# sleep 5 seconds
time.sleep(5)
print 'long time task finished'
return x + y
我用 django - 1.8 , 芹菜- 4.0 , amqp = 2.1.1 其中myporj是我的Django项目名
请帮我解决这个问题
我也发现这个错误。
原因很简单。芹菜4。X就是不支持windows。
http://docs.celeryproject.org/en/latest/faq.html does-celery-support-windows .
所以,我猜你需要尝试更早的版本或切换到linux系统。