cellery ImportError & AttributeError

本文档总结了使用Celery过程中遇到的一些常见问题及其解决方案,包括运行worker时的路径问题、Flask环境下属性错误、未注册的任务类型警告以及Redis连接配置问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

 

 

一、zz的问题

  celery 运行work要进入到 文件所在的文件夹下执行

 

二、AttributeError: 'Flask' object has no attribute 'user_options'

  解决方法:  

celery -A application.controllers.routes:celery worker --loglevel=info

  example:celery -A hello:celery worker --loglevel=info

  source link:http://stackoverflow.com/questions/34333727/starting-celery-in-flask-attributeerror-flask-object-has-no-attribute-user

三、Received unregistered task of type

[2016-11-08 17:43:42,023: ERROR/MainProcess] Received unregistered task of type u'proj.ce_tasks.add'.

  需要将这个task添加到 CELERY_IMPORTS 元组中

  source link:http://stackoverflow.com/questions/9769496/celery-received-unregistered-task-of-type-run-example

 

四、redis MISCONF  

consumer: Cannot connect to redis://localhost:6379/2: MISCONF Redis is configured to save RDB snapshots, but is currently not able to persist on disk. Commands that may modify the data set are disabled. Please check Redis logs for details about the error..

   见redis 配置持久

 

  

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值