Skip to content

leonardo-modules/leonardo-celery

Repository files navigation

Leonardo Celery Worker

This module provide worker for hard work around periodical syncing and updating caches, sending emails or whatever you need do asynchronously.

Installation

pip install leonardo-celery
pip install django-leonardo[celery]

Settings

BROKER_URL = 'redis://localhost:6379/0'

BROKER_URL = 'amqp://user:password@127.0.0.1:5672/leonardo'

Set custom scheduler and result backend

CELERY_RESULT_BACKEND = 'djcelery.backends.database:DatabaseBackend'

CELERYBEAT_SCHEDULER = "djcelery.schedulers.DatabaseScheduler"

Start worker

python manage.py celery worker -B -E

Syncing state

For syncing state to databse run celerycam

python manage.py celerycam

Tasks are discovered by standard mechanism:

app.autodiscover_tasks(lambda: settings.INSTALLED_APPS)

Use smart caching

Use cacheback jobs for fetching data asynchronously.

pip install leonardo-celery[cacheback]

Define your jobs. More about Jobs http://django-cacheback.readthedocs.org/en/latest/usage.html#as-an-instance-of-cacheback-job

Read More

About

Celery workers for Leonardo CMS

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages