达芬奇CMS背景工作人员
leonardo-celer的Python项目详细描述
这个模块为工作人员提供围绕定期同步和更新缓存、发送电子邮件或任何你需要异步做的艰苦工作。
Settings
BROKER_URL='redis://localhost:6379/0'BROKER_URL='amqp://user:password@127.0.0.1:5672/leonardo'
设置自定义计划程序和结果后端
CELERY_RESULT_BACKEND='djcelery.backends.database:DatabaseBackend'CELERYBEAT_SCHEDULER="djcelery.schedulers.DatabaseScheduler"
Start worker
python manage.py celery worker -B -E
Syncing state
用于将状态同步到数据库运行celerycam
python manage.py celerycam
任务由标准机制发现:
app.autodiscover_tasks(lambda: settings.INSTALLED_APPS)
Use smart caching
使用cacheback作业异步获取数据。
pip install leonardo-celery[cacheback]
定义你的工作。有关作业的详细信息http://django-cacheback.readthedocs.org/en/latest/usage.html#as-an-instance-of-cacheback-job
Read More
- https://celery.readthedocs.org/en/release21-maint/userguide/monitoring.html#starting-the-monitor
- http://celery.readthedocs.org/en/latest/index.html
- https://github.com/django-leonardo/django-leonardo
- https://github.com/michaelkuty/django-cacheback
- http://django-cacheback.readthedocs.org/en/latest/usage.html#as-an-instance-of-cacheback-job