码迷,mamicode.com
首页 > 其他好文 > 详细

Celery提交任务出错?

时间:2019-01-19 15:17:08      阅读:322      评论:0      收藏:0      [点我收藏+]

标签:pack   RKE   pytho   ISE   war   expec   port   app   img   

跟着官方的入门教程部署和运行的,为啥报这个错?

tasks.py

# -*- encoding:UTF-8 -*-

from celery import Celery

brokers = redis://localhost:6379
backend = redis://localhost:6379

app = Celery(tasks, broker=brokers, backend=backend)
app.control.purge()


@app.task
def add(x, y):
    return x + y

 

技术分享图片

 

>>> from tasks import add
>>> add.delay(6,6)
<AsyncResult: e1b8521e-e8a1-4431-8232-b0cbe7a35e9e>
 
[2017-08-08 19:14:32,580: ERROR/MainProcess] Task handler raised error: ValueErr
or(not enough values to unpack (expected 3, got 0),)
Traceback (most recent call last):
  File "c:\python352\lib\site-packages\billiard\pool.py", line 358, in workloop
    result = (True, prepare_result(fun(*args, **kwargs)))
  File "c:\python352\lib\site-packages\celery\app\trace.py", line 525, in _fast_
trace_task
    tasks, accept, hostname = _loc
ValueError: not enough values to unpack (expected 3, got 0)
[2017-08-08 19:15:46,049: ERROR/MainProcess] Task handler raised error: ValueErr
or(not enough values to unpack (expected 3, got 0),)
Traceback (most recent call last):
  File "c:\python352\lib\site-packages\billiard\pool.py", line 358, in workloop
    result = (True, prepare_result(fun(*args, **kwargs)))
  File "c:\python352\lib\site-packages\celery\app\trace.py", line 525, in _fast_
trace_task
    tasks, accept, hostname = _loc
ValueError: not enough values to unpack (expected 3, got 0)

解决方案:celery -A your_app_name worker --pool=solo -l info 换这个试试

Celery提交任务出错?

标签:pack   RKE   pytho   ISE   war   expec   port   app   img   

原文地址:https://www.cnblogs.com/yunlongaimeng/p/10291548.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!