文件上传

This commit is contained in:
resonate
2022-01-24 12:52:12 +08:00
parent 9bfdac0953
commit 9b8d632995
10 changed files with 176 additions and 3 deletions
+18
View File
@@ -0,0 +1,18 @@
from celery import Celery
from entrance.config import celery as config
from entrance.config.celery import broker_url
celery = Celery(__name__, broker=broker_url)
def register_celery(app):
celery.config_from_object(config)
class ContextTask(celery.Task):
def __call__(self, *args, **kwargs):
with app.app_context():
return self.run(*args, **kwargs)
celery.Task = ContextTask