Setup of documents view
This commit is contained in:
9
eveai_app/worker/celery_utils.py
Normal file
9
eveai_app/worker/celery_utils.py
Normal file
@@ -0,0 +1,9 @@
|
||||
def init_celery(celery, app):
|
||||
celery.conf.update(app.config) # Load all configurations form Flask app including Queue settings
|
||||
|
||||
class ContextTask(celery.Task):
|
||||
def __call__(self, *args, **kwargs):
|
||||
with app.app_context():
|
||||
return self.run(*args, **kwargs)
|
||||
|
||||
celery.Task = ContextTask
|
||||
Reference in New Issue
Block a user