Skip to main content

Task Queue

Some of the Saleor’s functionality depends on a task queue system to manage asynchronous and periodic tasks. We recommend using Celery with Redis as the message broker. For more information, please visit official Celery documentation.

Periodic tasks

Celery Beat is a scheduler that triggers background tasks at regular intervals. Some of the Saleor's features can't be used without proper task scheduler setup. In order to start Celery Beat server:

  1. Specify CELERY_BROKER_URL environmental variable which points to task broker (we recommend using Redis as a broker database):
set CELERY_BROKER_URL="<broker url>"

An example of the Redis broker url, running on localhost and port 6379, looks like: redis://localhost:6379/0.

  1. Run Celery worker:
celery --app saleor.celeryconf:app worker -E --loglevel=info
  1. As a separate process run Celery Beat:
celery --app saleor.celeryconf:app beat --scheduler saleor.schedulers.schedulers.DatabaseScheduler 

Below is a list of Saleor features fired up by celery beat with default schedules:

Tasks run in intervals:

Tasks run at specific time:

important

It is important to understand that without proper task scheduler setup, the actions above will not be triggered.