Browse Source

Include backend argument when instantiating Celery

Not including the backend argument can lead to AttributeError:
DisabledBackend object has no attribute for '_get_task_meta_for'.

See e.g.
http://stackoverflow.com/questions/23215311/celery-with-rabbitmq-attributeerror-disabledbackend-object-has-no-attribute.

At the same time, including the backend argument doesn't seem to harm anything else.
pull/1483/head
Andrew 10 years ago committed by Markus Unterwaditzer
parent
commit
337a9d6172
  1. 3
      docs/patterns/celery.rst

3
docs/patterns/celery.rst

@ -36,7 +36,8 @@ This is all that is necessary to properly integrate Celery with Flask::
from celery import Celery
def make_celery(app):
celery = Celery(app.import_name, broker=app.config['CELERY_BROKER_URL'])
celery = Celery(app.import_name, backend=app.config['CELERY_BACKEND'],
broker=app.config['CELERY_BROKER_URL'])
celery.conf.update(app.config)
TaskBase = celery.Task
class ContextTask(TaskBase):

Loading…
Cancel
Save