mirror of
https://github.com/fastapi-practices/fastapi_best_architecture.git
synced 2025-08-17 13:54:14 +08:00

* Add support for celery dynamic tasks * Update the celery conf * Update the celery task tables name * Refactor the celery task-related interfaces * Optimize auto-discovery tasks * Remove redundant config * Refine the business codes * Optimize crontab validation returns * Update dependencies in pyproject toml * Fix some bugs * Update dependencies * Update the version to 1.7.0 * Fix update and delete event
13 lines
292 B
Python
13 lines
292 B
Python
#!/usr/bin/env python3
|
|
# -*- coding: utf-8 -*-
|
|
from anyio import sleep
|
|
|
|
from backend.app.task.celery import celery_app
|
|
|
|
|
|
@celery_app.task(name='task_demo_async')
|
|
async def task_demo_async() -> str:
|
|
"""异步示例任务,模拟耗时操作"""
|
|
await sleep(20)
|
|
return 'test async'
|