关闭

celery不能root用户启动解决(C_FORCE_ROOT environment)

1155人阅读 评论(0) 收藏 举报
分类:

celery不能root用户启动解决(C_FORCE_ROOT environment)



Running a worker with superuser privileges when the
worker accepts messages serialized with pickle is a very bad idea!

If you really want to continue then you have to set the C_FORCE_ROOT
environment variable (but please think about this before you do).

解决方法
```
from celery import Celery, platforms

app = Celery('tasks', broker='amqp://myuser:

mypassword@localhost :5672/vhost')

platforms.C_FORCE_ROOT = True #加上这一行

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

0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:41406次
    • 积分:586
    • 等级:
    • 排名:千里之外
    • 原创:6篇
    • 转载:35篇
    • 译文:1篇
    • 评论:0条
    文章分类