celery使用root用户启动报错处理

celery使用root用户启动报错处理

Dawn
2020-11-26 / 0 评论 / 334 阅读 / 正在检测是否收录...
  • 报错信息

    RuntimeError: 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).
  • 解决办法
  1. 在celery.py文件中导入celery的platforms模块
  2. 添加platforms.C_FORCE_ROOT = True

如图:

image-20201126161857907

1

评论 (0)

取消