Skip to content
Myr

Updated Celery pattern

Before adoption: this commit came in with the history the project adopted, so no landing records it.

The given pattern caused Celery to lose the current Context

authored by Geoffrey Bauduin · committed by Geoffrey Bauduin · parent cd13a5c · Browse files · 1 file+1 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+1 added−1 removed

  • other:+1 added−1 removed

1 file+1 added−1 removed

modified:docs/patterns/celery.rst+1 added-1 removed
42 unmodified lines
43 class ContextTask(TaskBase):44 abstract = True45 def __call__(self, *args, **kwargs):46 with app.app_context():47 return TaskBase.__call__(self, *args, **kwargs)47 return self.run(*args, **kwargs)48 celery.Task = ContextTask49 return celery5051The function creates a new Celery object, configures it with the broker
42 unmodified lines