Updated Celery pattern

The given pattern caused Celery to lose the current Context
This commit is contained in:
Geoffrey Bauduin 2016-10-11 15:27:48 +02:00
parent cd13a5cf62
commit 2b03eca1b7

View file

@ -44,7 +44,7 @@ This is all that is necessary to properly integrate Celery with Flask::
abstract = True
def __call__(self, *args, **kwargs):
with app.app_context():
return TaskBase.__call__(self, *args, **kwargs)
return self.run(*args, **kwargs)
celery.Task = ContextTask
return celery