feat: celery 异步框架测试运行。

celery 不支持在 windows 上调用 async 函数。所有要部署在 linux 上,部署待测试。
This commit is contained in:
AdminWhaleFall
2022-05-14 22:57:28 +08:00
parent c823cc2d5b
commit 82c7d38b59
6 changed files with 130 additions and 0 deletions

17
celery_server/celery.py Normal file
View File

@@ -0,0 +1,17 @@
from celery import Celery
from celery.utils.log import get_task_logger
app = Celery(
'celery_server',
include=[
'celery_server.tasks'
]
)
app.config_from_object(
'celery_server.config',
)
logger = get_task_logger(__name__)
if __name__ == '__main__':
app.start()