【发布时间】:2016-05-07 16:22:12
【问题描述】:
我成功设置了 Celery 3.1 + Django 1.6 + Djcelery,任务正在运行,一切都很好。在 Django 管理界面中,我看到带有选项的 Djcelery 菜单,但在 Tasks 选项卡上看不到任何任务,在 Workers 选项卡上没有工作人员。
如何配置让它们自动存储状态?
我的设置.py:
# Celery settings
#BROKER_URL = 'amqp://guest:guest@localhost//'
BROKER_URL = 'django://'
from kombu.serialization import registry
registry.enable('pickle')
#: Only add pickle to this list if your broker is secured
#: from unwanted access (see userguide/security.html)
CELERY_ACCEPT_CONTENT = ['json', 'pickle']
CELERY_TASK_RESULT_EXPIRES=3600
#CELERY_RESULT_BACKEND='amqp'
CELERY_RESULT_BACKEND='djcelery.backends.database:DatabaseBackend'
# postgresql
#CELERY_RESULT_BACKEND = 'db+postgresql://postgres:111222@localhost/graphgrail'
#CELERY_RESULT_BACKEND='djcelery.backends.cache:CacheBackend',
CELERY_RESULT_SERIALIZER = 'json' #json pickle msgpack
CELERY_TASK_SERIALIZER = 'json'
CELERY_IMPORTS=["vk_wall.tasks"]
【问题讨论】: