Okay, this branch has become a mess. Opening a new branch with a semi-working celery setup and then will add in my routes and html pages. This branch has reached it's deadend
This commit is contained in:
13
application/utils.py
Normal file
13
application/utils.py
Normal file
@ -0,0 +1,13 @@
|
||||
from celery import Celery
|
||||
|
||||
def make_celery(app):
|
||||
celery = Celery(app.import_name)
|
||||
celery.conf.update(app.config["CELERY_CONFIG"])
|
||||
|
||||
class ContextTask(celery.Task):
|
||||
def __call__(self, *args, **kwargs):
|
||||
with app.app_context():
|
||||
return self.run(*args, **kwargs)
|
||||
|
||||
celery.Task = ContextTask
|
||||
return celery
|
||||
Reference in New Issue
Block a user