celery 启动报错:django.db.utils.DatabaseError: DatabaseWrapper objects created in a thread can only be used in that same thread. The object with alias 'default' was created in thread id 2201580366656 and this is thread id 2201786259232
将启动方式改为:celery -A yourapp.celery worker --loglevel=info --pool=solo
本文解决了一个关于Celery启动时遇到的Django数据库错误问题,该问题源于Celery任务执行线程与创建数据库连接线程不一致导致。通过更改Celery的启动参数,将线程池设置为solo模式来解决此问题。

被折叠的 条评论
为什么被折叠?



